libgdxtexturepacker

Libgdx texturepacker doesn't pack all images


When i run the texturepacker in libgdx i have the problem that it doesn't pack all the images in one big sprite sheet. If i for example have 4 images and it only packs 3 of them. Note that 2 images are the exact copies of eachother so maybe that has something to do with it.


Solution

  • LibGDX by default doesn't pack images which are exact copies. This can be overridden by setting alias to false in your configuration.

    alias: If true, two images that are pixel for pixel the same will only be packed once. (default: true)

    However, usually it is beneficial to pack the same images only once because it creates a smaller texture. You can still use both names when getting TextureRegion objects or creating Sprite.