开发者

xcode and sprite sheet

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?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜