退出游戏
cc.director.end();
End the life of director in the next frame
暂停游戏
cc.director.pause();
cc.game.pause();
cc.director.pause():
Pause the director's ticker, only involve the game logic execution.
It won't pause the rendering process nor the event manager.
If you want to pause the entier game including rendering, audio and event,
please use cc.game.pause()
注:cc.director.isPaused()返回值为布尔类型,可用于判断。
恢复游戏
cc.director.resume();
Resume game logic execution after pause, if the current scene is not paused, nothing will happen.
本文介绍了Cocos2d-x中游戏逻辑的控制方法,包括如何使用cc.director.end()退出游戏、cc.director.pause()及cc.game.pause()暂停游戏的不同之处,以及如何通过cc.director.resume()恢复游戏。还解释了cc.director.isPaused()的返回值及用途。
766

被折叠的 条评论
为什么被折叠?



