Search code examples
cocos2d-iphoneccspritecocos2d-x

How to pause animated sprite animation in Cocos2d?


I want to pause/unpause animation for particular sprite when proper message appears. I would do this by CCNode::stopAllActions() but it cancels all the animations which are then meant to set up again. I just want to do it in a quick pause/unpasue way. Anyone have a clue for efficitne way on this subject?


Solution

  • [yourSprite pauseSchedulerAndActions]
    

    and to resume

    [yourSprite resumeSchedulerAndActions]