Skip to content

Instantly share code, notes, and snippets.

@kyokomi
Created March 15, 2014 09:26
Show Gist options
  • Save kyokomi/9563968 to your computer and use it in GitHub Desktop.
Save kyokomi/9563968 to your computer and use it in GitHub Desktop.
EventDispatherについての調査資料1
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() {
Director::getInstance()->startAnimation();
// if you use SimpleAudioEngine, it must resume here
// SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
CCLOG("バックグラウンドから復活しました!!");
auto base_scene = Director::getInstance()->getRunningScene();
auto main_scene = base_scene->getChildren().at(0);
static_cast<RogueScene*>(main_scene)->onApplicationWillEnterForeground();
}
void RogueScene::onApplicationWillEnterForeground() {
this->showCommonWindow("再開します。", [this](Ref* pSender){
this->hideCommonWindow();
}, [this](Ref* pSender){
this->hideCommonWindow();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment