![texturepacker how to use texturepacker how to use](https://i.ytimg.com/vi/uaYTnJtB6RA/maxresdefault.jpg)
![texturepacker how to use texturepacker how to use](https://i.ytimg.com/vi/-SgZ3Enpau8/maxresdefault.jpg)
After running, it will traverse all the folders in the originalImages directory, and then package the pictures in each folder into a sprite sheet, this sprite sheet The name is the same as the name of the folder, and then copy the packaged sprite sheet file in two copies, one is stored in the spriteSheets directory, and the other is copied to the directory where our program uses pictures.įor example, when I run the script, three sprite sheets will be generated, button.png, ist, checkBox.png, ist, common.png, ist, and they will be stored in the spriteSheets directory and In the images directory under the res directory (usually the images directory under the res directory is used to store the pictures used in the program). Our script tool is stored in the tools folder. The final directory structure is shown below: Go to the res/images directory, so for clarity, create another folder. Finally, we generally store the pictures used in the project. Then, we create a directory spriteSheets to store the printed pictures. Here we create a new directory called originalImages, then find some pictures, throw them into this directory, and sort them into different folders, and then we Create another directory to store our script tools for packaging sprite sheets. We need a directory to save all the original (not typed in the sprite sheet) pictures. Next, for the convenience of explanation, we create a new test project foo, here is the project created by the quick-cocos2d-x-2.2.1-rc engine as an example, the directory structure after creation is as follows: Under normal circumstances, you will see various parameters of texturepacker and instructions for how to use it, as shown below: After some preparations are made, we can execute the texturepacker command on the command line. The article mentioned above has more detailed instructions. The specific method of downloading and installing TexturePacker and its command-line tool is not mentioned. Next, I will talk about how to use this TexturePacker command line tool in the project and some experience in using it. Later, through searching, I saw an article on using TexturePacker by raywenderlich, which introduced the usage of TexturePacker in more detail, especially the use of its command line tool and the integration of this tool and xcode, which gave me thought The answer you want. So I thought about how to reduce the workload of packaging sprite sheets as much as possible and improve the efficiency of development.
#Texturepacker how to use manual
Then, considering the difference between the sprite sheet configuration packaged for the Android platform and iOS, as well as the picture changes, configuration Optimization and other conditions, it takes a huge amount of work to pack the sprite sheet, and this does not consider various problems caused by manual misoperation. In order to generate these sprite sheets, a lot of manual labor needs to be done. With the increase of pictures, there will be more and more sprite sheets. Generally, we use his gui version to make sprite sheets, which are purely manual operations, just like the picture below.Īt the beginning our project also used this method, but later found that this method has a big problem in development. The only possibility I saw is to use “Collection of Images” then use the source string to look up the tile in the TexturePacker xml in my framework.TexturePacker is a commonly used tool for making sprite sheets, which provides many useful functions. I know that this is logical but I cannot figure out how to solve this issue without writting a new tile map editor myself which would then read the TexturePacker Xml data.
#Texturepacker how to use update
However, when I add a sprite to my spritesheet in TexturePacker and then press Ctrl+T in Tiled to update the spritesheet, all the tiles have wrong id’s because the order of tiles on the sheet might have changed. I then use this spritesheet in Tiled to create my map. I am using TexturePacker to pack my sprites into a spritesheet.