void AppDelegate::applicationDidEnterBackground()
{
auto director = Director::getInstance();
// director->stopAnimation();
director->getEventDispatcher()->dispatchCustomEvent(“game_on_hide”);
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
auto director = Director::getInstance();
// director->startAnimation();
director->getEventDispatcher()->dispatchCustomEvent(“game_on_show”);
}
构建出的代码中,将
// director->stopAnimation();
// director->startAnimation();
注释掉就可以了,但是打开的情况下,切回来会挺住,无法进行操作
