4
votes

I have a question, I have read all over the web about how to animate a sprite sheet, but I just wanted to know of a simple way to just load a sprite sheet that has multiple images of lets say a background (so imagine something like the "right corner" the "top banner" and "left corner" of a banner).

How can I display in a uiview the portion of each element (sitting in the sprite sheet) and then place a title over the "top banner" element. Inother words, like a css master would do in htlm for a website?

And do I need to import cococa2s lib inorder to do this or can I do it with native ios sdk?

2

2 Answers

1
votes

if you use cocos2d there are a lot of tools to help you make and use. Texturepacker is one great tool for helping you optimize and make spritesheets

you can see how to do this here: http://www.raywenderlich.com/2361/how-to-create-and-optimize-sprite-sheets-in-cocos2d-with-texture-packer-and-pixel-formats

0
votes

You can use Sprite Master to generate your sprite sheet. It exports Generic XML file for coordinate data.

Then, you can look at this link for cropping/dividing one UIImage into smaller UIImages.