I have a three-second PNG sequence (a logo animation) that I’d like to display right after my iOS app launches. Since this is the only animated sequence in the app, I’d prefer not to use Cocos2D.
But with UIImageView’s animationImages, the app runs out of memory on iPod Touch devices.
Is there more memory-conscious/efficient way to show this animation? Perhaps a sprite sheet class that doesn’t involve Cocos2D? Or something else?
If this is an animated splash screen or similar, note that the HIG frowns on such behavior (outside of fullscreen games, at least).
If you’re undeterred by such arguments (or making a game), you might consider saving your animation as an MPEG-4 video and using
MPMoviePlayerControllerto present it. With a good compressor, it should be possible to get the size and memory usage down quite a lot and still have a good quality logo animation.I doubt you’re going to find much improvement any other way — a sprite sheet, for example, is still going to be doing the same kind of work as as sequence of PNGs. The problem is that for most animations, a lot of the pixels are untouched from frame to frame… if you’re presenting it just as a series of images, you’re wasting a lot of time and space on temporally duplicated pixels. This is why we have video codecs.