Playing sequence of PNG files in cocos2d iphone -
I want to play a sequence of png files for animation I tried to execute the following code in the Cocos 2D iPhone < P>
(zero) onEnter {[super onEnter]; RoadSprite = [[Sprite Phantom Withfile: @ "R00.png"];]; [Roadsprit set set: CCP (240,160)]; [Self linking child: rhodaprita z: 5]; Animation * animation = [animation animation xname: @ "animation" delay: 0]; For (int i = 0; i
R00.png is displayed in the end when played instead of animation. Someone can help me find fault.
You are delaying 0. The delay does not mean "how long should I wait before running this animation" but it means "how long I should wait before displaying each picture". Setting to 0 would mean that it does not wait at all, and your animation is over! Tada!
Set the length of time between each frame in normal animation, it is 1.0 F / 24.0F (or 0.04, round off)
Comments
Post a Comment