Search code examples
c++xcodecocos2d-x

Pause the particular scene in cocos2d-x


I am developing a game using cocos2d-x. I want to pause the particular scene, when user press the pause button.

Thanks.


Solution

  • You can pause a particular scene in two different ways

    1.) Use CCDirector::sharedDirector()->stopAnimation(); to pause and CCDirector::sharedDirector()->startAnimation(); to resume.

    2.) Use CCDirector::sharedDirector()->pause(); to pause and CCDirector::sharedDirector()->resume(); to resume.