tags:

views:

1226

answers:

2

What is the most efficient way to do this? I have four images that I would like to play to become an animated sprite. Thanks in advance!

A: 

How about:

UIImageView *imageView = …
imageView.animationImages = <array of images>
Andrew Pouliot
Well in cocos2d I'm using a Sprite.
+3  A: 

Check out this sample code.

Stu
I did but for some reason I keep getting warnings.
What kind of warnings are you getting? I'm new to cocos2d but I can try to help. For me I simply double click SpriteTest.xcodeproj, click "build and run", and the project seems to work fine. I see "succeeded" in the bottom right and don't have any warnings.
Stu
There is also some more sample code under the "tests" directory in your cocos2d download. This is a little more complicated so I preferred the first link.
Stu
When I use his code I build with no warnings but when I try to add it to my project I get some warnings. Maybe I don't have all the frameworks added to my project?
I don't know why you're getting the warnings, but if you are correct then this tutorial will teach you how to add the necessary frameworks. http://monoclestudios.com/cocos2d_whitepaper.html
Stu
Your project should contain all the necessary frameworks to use that code. You implemented it wrong. Be specific about the error.
deeb