Tag Archives: texture packer

Exporting sprite sheet

Modding / Development Tools – Texture Packer

The Texture Packer

So, I saw a few texture packers online, and if you saw our website ( click here to see it! ), we also made one in the past, well… depends how you define “made…” lol it was very sloppy and no-one really was able to use it except me since I knew all of the flaws and bugs of it and was just too lazy to fix it up and decided to stay with it…
well, fast forward few months, well more than just few, since it was originally made for the older game, I decided to make a new one! and this time to make it more friendly to the user and very… very simple… literally anyone can use it.
Texture Packer

To start off, you will need few things

  1. A template that is supported by the game
  2. All the frames required for that template
  3. Texture Packer itself

Texture Packer

Step 1


  • simply write in the whole directory the file is located in, including the file’s name at the end (not recommended)
  • Select a template by pressing `Select Template` and finding the template in the file search. (not ideal)
  • simply drag and drop the `tml` file into the typing area! (Highly recommended, very simple)


Texture Packer
Now, you may be asking yourself, “what is a template file? what’s so special about it?..” well, nothing really, just the structure of that file is simply the only type of structure the texture packer will read.
Texture Packer

  • the number following `padx` is the padding along the X axis between each sprite
  • the number following `pady` is the padding along the Y axis between each sprite
  • the number following `cols` is the number of columns of sprites in each row
  • the file names following order are the files in order from left to right in the sprite sheet, if, for example there are more than 5 files, and there are only 5 columns per row, it will start a new row at file 6
  • if there is “NULL” instead of file name, this space will be ignored and will leave that spot empty and move on to the next column.
  • once it reaches end, it ends and exports the file.

That’s it, pretty simple!

After we selected the template, we would name the file (this action is included in step 3’s GIF file), the name needs to be compatible with the game. If it is a mob/NPC, as long as you also make a mob/NPC with the same name, it will be compatible.

add in the sprites!

Texture Packer

Step 4

Texture Packer

this will result in two files, one of which is the actual sprite sheet, the next is simply instructions for the game on how to load the sprite sheet.

Texture Packer
Texture Packer

From top to bottom:

  • Width
  • Height
  • Padding along the X axis
  • Padding along the Y axis


Texture Packer v01

Texture Packer

As the lead programmer of the games and projects we have developed so far, I found myself facing some struggles along with the artists as they sometimes just don’t make the sprite sheets as needed and the sprite sheets aren’t always optimized as best as they could be. Our artists also sometimes face some issues and its hard to explain to new artists, ones who never actually made sprite sheets for games, to make a “perfect” sprite sheet that will work flawlessly with our engine and other aspect of the game being developed.

So, before we start developing our next game in-depth, I decided to work on a side project to help out our artists in the future and make it easier on the programmers to use the sprite sheets.

After a long night of programming, I ended up with the new texture packer (image attached) which is very basic for now, but fits our needs. you simply drop all the sprites and frames you want to be added into the sprite sheet into the white rectangle, then name the file with the top text field, followed by the width and height desired and then apply it. the texture packer will organize the sprites position (right now with a very simple algorithm which I will work on in the future) and finally.. when you are ready, hit export and the sprite sheet will be exported as a “.png” file (soon it will also export a “.json” file that will hold all of the coordination and other aspects each sprite will have.)

stay tuned for more updates on our future project!