Packing textures
Currently, we have our textures as individual files. For a game the size of Flappee Bee, that would normally be OK, since during the game we have four files. However, what would happen if we started adding more and more in-game textures? Eventually, we would start slowing down the game. The reason for this is that the underlying OpenGL is performing something called a bind for every different texture it renders. Binding is relatively expensive. To combat this, we can combine our assets into a single sheet, ah! You might be thinking, "But now I have to know where in the sheet the image is?", "What pixels to cut out?", and "What if they are rotated or white-space trimmed to save space in the image?" Well, fear not; LibGDX has a tool for this that will save us time—TexturePacker
.
Note
Here is a link to the LibGDX wiki that will let you look deeper into the Texture Packer tool:
However,...