Pause the game and stop taking inputs

Hello,
I’m trying to pause and resume the game and using cc.game.pause() and cc.game.resume() for the same. But the problem is it still takes the input. I have a question mark button that displays the instructions. When I run cc.game.pause(), the question mark button is still clickable.
Is there any other way to pause the game and stop takin touch inputs like cc.eventManager.pauseTarget() and cc.eventManager.resumeTarget() in cocos2dx?

Thank you

hi

    this.node.pauseSystemEvents(true)
    this.node.resumeSystemEvents(true)

these two will do what you are looking for :wink:
The argument expects a bool, true means all children of this node should also pause/resume

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.