0

I'm using TexturePacker to make a texture atlas. The result are 2 PNGs. I need certain images(sprites) to be deposited into only one of the pngs so I only have to bind only one texture to use in some shaders that I'm using. How can I force certain sprites to pack themselves at the same place and not dispersed randomly into the 2 PNGs?

gogonapel
  • 788
  • 6
  • 17

2 Answers2

1

Perhaps I've misunderstood your question, but you could just use texture packer twice, once with each set of sprites. Then you know which sprites will be in which png

rbennett485
  • 1,907
  • 15
  • 24
1

You can create subdirectories within the directory of your source images and sort them into pages by placing them in different subdirectories. Each subdirectory will get its own unique Texture(s). The advantage of this method is that you have only one TextureAtlas to manage. The correct Texture will be automatically grabbed when you create sprites or get TextureRegions.

If you set flattenPaths to true, then you won't have to worry about what you name the subdirectories. If you leave it as the default false, then you must include the subdirectory name as part of the sprite name with a /.

Tenfour04
  • 83,111
  • 11
  • 94
  • 154