How to properly pause the game for pause menu in cocos creator?

Hi, I cant find anything about freezing the timer or pause the full game with audio when pause menu appears. any help or suggestion will be appreciated. thanks in advance.

You can use the Director to pause your game. http://www.cocos2d-x.org/docs/creator/api/en/classes/Director.html

I have used cc.game.pause and cc.director.pause but both didnt work. settimeout function still runs and audio plays. Is there any code to freeze the game time.? thanks in advance

I think setTimeout is JavaScript direct API so it’s not bound to Cocos engine, so you may want to use scheduler instead. As for audio, I think you need to use pauseAll from cc.AudioEngine itself, then use cc.director.pause.

Thanks mate. I will check scheduler function. If you have any reference for the same please suggest.