Game Development Reference
The free version TexturePacker Essential is sufficient for basic needs and you can use it
to create commercial apps. It doesn't have the Pro version's more advanced features,
such as saving high-resolution data for Retina displays, scaling down images for non-
Retina displays on the fly, or optimizing the graphics to save memory. The Pro version
requires a paid license that comes at a reasonably low price.
You can also run TexturePacker as a command-line tool via the Terminal app, allowing
it to be integrated in your Xcode build process. You can find more information on the
TexturePacker command-line tool and how to use it on the TexturePacker web site.
In this chapter, I use TexturePacker Pro because it can also export to the PVR image
format, the native image format for iPhone's PowerVR graphics chip. The Pro version
also conveniently creates the SD and HD textures you need to be able to run the project
on all variants of the iPhone.
Preparing the Project for TexturePacker
To use TexturePacker, the project Sprites02 need a little reorganizing. Currently all im-
ages in the HD and SD variants are in the Resources folder. Because you're going
to use a texture atlas that contains all the images in one texture, the individual images
don't need to be copied onto the device anymore.
First create a new folder called Assets that keeps all the source images and the save
file for the texture atlases. You don't need to have both HD and SD versions of each
image anymore because TexturePacker will scale down the images for you. So, with
TexturePacker you're working only with the HD variants, and the image files don't
need to have the -hd suffix anymore. Figure 6-5 shows the Assets folder of the