I know that you already have an answer, but I wanted to share my solution, because I got into this link when investigating the same problem. I also posted this on cocos2d forums.
- (void)pauseSchedulerAndActionsRecursive:(CCNode *)node { [node pauseSchedulerAndActions]; for (CCNode *child in [node children]) { [self pauseSchedulerAndActionsRecursive:child]; } } - (void)resumeSchedulerAndActionsRecursive:(CCNode *)node { [node resumeSchedulerAndActions]; for (CCNode *child in [node children]) { [self resumeSchedulerAndActionsRecursive:child]; } }
I have one scene and two layers, a scene / gameplay level and a menu layer. My menus revive and go out, and I wanted my pause menu to be able to revitalize and turn off. So I just added the above functions to my scene / gameplay level. Then, when the user pauses, I call pauseSchedulerAndActionsRecursive: at my scene / gameplay level and add my menu layer to the scene above. My menu swallows all touches, so the touch also turns off at the scene / game level, until the menu layer is up. Then just call the resumeSchedulerAndActionsRecursive: method to resume. Hope this helps someone.
source share