0
\$\begingroup\$

I am new to cocos2d. I am using CCAnimation. It's working fine, except I want to pause the animation occasionally. How do I do this?

Here's what I'm doing so far:

[mySprite runAction:[CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:walkAnim]]];
\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

You can pause all the actions for a node, but not individually.

Basically you can do something like this

[[CCActionManager sharedManager] pauseTarget:node];

[[CCActionManager sharedManager] resumeTarget:node];
\$\endgroup\$
0
\$\begingroup\$

There's no pause per se. You can use stopAction or stopActionByTag to stop it and run it again when you want to resume.

Check the API here for these methods.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .