在游戏过程中用户暂停了游戏,注意这时游戏并没在后台,过段时间手机进入待机状态,如果从待机状态恢复时由于游戏并未在后台,则游戏继续运行,想弄成还是暂停状态怎么处理?
cocos2d里有以下2个方法,那quick里怎么处理
void AppDelegate::applicationDidEnterBackground() {
CCDirector::sharedDirector()->stopAnimation();
// if you use SimpleAudioEngine, it must be pause
// SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() {
CCDirector::sharedDirector()->startAnimation();
// if you use SimpleAudioEngine, it must resume here
// SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
}