I am making a Pokemon Clone, using libgdx. I have the different types of sprites: e.g. Back, front, back shiny, and front shiny.

The current way the Texture Packer combines the textures seems to be semi-randomly. I would like to be able to tell it to put the sprites together based on number, because my sprites go:

  • 003
  • 003b
  • 003bs
  • 003s

Where the 003 is the pokedex number, and the b is for back, and s for shiny.

Two questions here:

  1. Is there a way to get it to sort the textures in some way?
  2. Is there a benefit to this sorting?

There's no real benefit to sorting those sprites by not-Pokemon index; the texture packer doesn't care what order the not-Pokemon are in, it cares about minimizing the atlas size. I'd just let it do its thing, the atlas file already specifies the position, dimensions, and other settings for each sprite. All you have to do is reference them by name.

  • \$\begingroup\$ Reminds me that I stopped asking why the typeface sprite texture packer will do very strange things, like drawing the character flipped left to right or rotated 90 degrees (or both). I just assume it knows better than I do and walk away slowly (even if it does make changing fonts a pain in the arse later). \$\endgroup\$ – Draco18s Dec 30 '15 at 21:08
  • \$\begingroup\$ Unfortunate that you can't control the packer because switching textures ain't free. \$\endgroup\$ – Steven Dec 30 '15 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.