Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I solved my problem by creating a animation with 1 frame </p> <pre><code>[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile: @"Actor.plist"]; spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"Actor.pvr.ccz"]; [self addChild:spriteSheet]; NSMutableArray *walkAnimFrames = [NSMutableArray array]; for(int i = 1; i &lt;2; ++i) { [walkAnimFrames addObject: [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName: [NSString stringWithFormat:@"clip000%d.png", i]]]; } CCAnimation *walkAnim = [CCAnimation animationWithFrames:walkAnimFrames delay:0.07f]; playWalkSound = [CCCallFuncN actionWithTarget:self selector:@selector(PlayRunningSound:)]; walkAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:walkAnim restoreOriginalFrame:NO]]; [actor runAction:[CCSpawn actions:walkAction, nil]]; </code></pre> <p>i used the above code where i want to pause my animation action. and added following code when i want to resume the animation action.</p> <pre><code>[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile: @"Actor.plist"]; spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"Actor.pvr.ccz"]; [self addChild:spriteSheet]; NSMutableArray *walkAnimFrames = [NSMutableArray array]; for(int i = 1; i &lt;= 8; ++i) { [walkAnimFrames addObject: [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName: [NSString stringWithFormat:@"clip000%d.png", i]]]; } CCAnimation *walkAnim = [CCAnimation animationWithFrames:walkAnimFrames delay:0.07f]; playWalkSound = [CCCallFuncN actionWithTarget:self selector:@selector(PlayRunningSound:)]; walkAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:walkAnim restoreOriginalFrame:NO]]; [actor runAction:[CCSpawn actions:walkAction, nil]]; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload