How to do animations using images efficiently in iOS

My suggestion is using Cocos2d, which is a framework based on Open GL specifically designed for games.

In your case, the advantages you would get are:

  1. using texture atlas instead of individual images to save as much memory as possible;

  2. using the PVR format for your images (vs. PNG); PVR is the native format of the iPhone/iPad graphics chip, and it will allow for more memory saving;

  3. you could also try and use a smaller footprint format for you images (i.e., RGB565 instead of RGB8888, 16 bits per pixel instead of 32).

If you think this could work for you, have a look at this tutorial.

You could do the same by using Open GL or Core Animation directly, but I think it is better letting Cocos2d deal with the low-level stuff.

For a Core Animation based tutorial for doing the same, have a look at this post. As you will see, you will implement a few classes for doing things that Cocos2d already offers you (together with many other features).

Leave a Comment