My project is using a Texture Atlas for sprite animations in Cocos2D. But now, I need to access one frame of pixel data from the Atlas. Is there a way to extract a single animation "frame" from the larger Atlas file as a UIImage?
1
votes
1 Answers
1
votes
I wrote a UIImage category for handling sprite sheets. Check out this, it may be helpful http://reecon.wordpress.com/2011/11/19/uiimage-sprite-additions-objective-c/
As noted earlier, this category bases on CGImageCreateWithImageInRect() but makes the process of extracting sprites from a single sprite sheet far more convenient and faster.