As I have mentioned already, texture memory is one of your core resources. In fact, it is common to run out of memory because of all the textures required to animate a typical 2D game. It is also time-consuming to load individual textures rather than loading on a larger texture. So, we have to come up with methods to use texture memory more efficiently.
One common technique designed to pack more textures into less space is known as atlasing. A texture atlas works much like a sprite sheet described earlier in this chapter. Instead of storing each texture as its own image, we pack all of the textures for the entire game into one or more textures known as atlases.
As the word suggests, an atlas works much like a map. We simply need to know the location of any particular image, and we can find and extract it out of the atlas. Every atlas consists of two parts:
The texture that contains all of the images
A text file that contains the positions of each image in the atlas