Cocos2D: Stop / Resume CCAction on CCSprite

I have two CCAnimations running on CCSprite. How to check if a specific action is performed in a sprite? And how can I pause / resume them as necessary?

I checked numberOfRunningAction in the actionManager, but it is not equal to the number I expect.

+6
cocos2d-iphone
source share
1 answer

Be sure to set the tag property for your two actions. Then call getActionByTag with the tag of your desired action. If your result is not equal to zero, the action is performed.

Unfortunately, you cannot pause any specific action. You can pause ALL actions (pauseSchedulerAndActions) or stop an individual action (stopActionByTag: or stopAction :), which removes it from the list of actions. Not what you want.

+3
source share

All Articles