本文整理汇总了C++中CCDirector::popToRootScene方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDirector::popToRootScene方法的具体用法?C++ CCDirector::popToRootScene怎么用?C++ CCDirector::popToRootScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCDirector
的用法示例。
在下文中一共展示了CCDirector::popToRootScene方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle_signal
void handle_signal(int signal)
{
static int internal_state = 0;
ScriptingCore* sc = ScriptingCore::getInstance();
// should start everything back
CCDirector* director = CCDirector::sharedDirector();
if (director->getRunningScene())
{
director->popToRootScene();
}
else
{
CCPoolManager::sharedPoolManager()->finalize();
if (internal_state == 0)
{
//sc->dumpRoot(NULL, 0, NULL);
sc->start();
internal_state = 1;
}
else
{
sc->runScript("hello.js");
internal_state = 0;
}
}
}
示例2: onQuit
void ConfigView::onQuit(cocos2d::CCObject *obj, TouchEventType tt){
switch (tt) {
case cocos2d::ui::TOUCH_EVENT_BEGAN:
{
}
break;
case cocos2d::ui::TOUCH_EVENT_MOVED:
{
}
break;
//但是内部的 WorldCup Scene 也要抛弃掉
case cocos2d::ui::TOUCH_EVENT_ENDED:
{
CCDirector* pDirector = CCDirector::sharedDirector();
CCScene* pScene = LoginScene::scene();
//pDirector->replaceScene(getTransScene(pScene));
//pDirector->replaceRootScene(getTransScene(pScene));
pDirector->popToRootScene();
//pDirector->replaceScene(getTransScene(pScene));
//Transition 场景存在 问题 一旦Transition 就会导致 touch无效 应该是 touch被关闭掉了 但是没有开启起来 TransitionScene 处理的代码问题
pDirector->replaceScene(pScene);
//退出登录清理状态
Logic::getInstance()->clearState();
}
break;
case cocos2d::ui::TOUCH_EVENT_CANCELED:
{
}
break;
default:
break;
}
}
示例3: LUA_EXECUTE_COMMAND
void LUA_EXECUTE_COMMAND(int nCommand)
{
if( nCommand == 12 ) //百度Android
{
#if (AGENT_SDK_CODE == 12)
JniMethodInfo methodInfo;
if( JniHelper::getStaticMethodInfo(methodInfo, "com/haowan123/kof/bd/GameBox", "dkAccountManager", "()V") )
{
methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID );
}
else
{
CCLOG("GameBox::openDKAccountManager method missed!");
}
#endif
}
else if( nCommand == 2 ) //360Android
{
#if (AGENT_SDK_CODE == 2)
JniMethodInfo methodInfo;
if( JniHelper::getStaticMethodInfo(methodInfo, "com/haowan123/kof/qh/GameBox", "doSdkAccountManager", "()V") )
{
methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID );
}
else
{
CCLOG("GameBox::doSdkAccountManager method missed!");
}
#endif
}
if( nCommand == 84 )
{
CCScriptEngineProtocol *pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
if( pEngine == NULL )
return;
CCLuaEngine *pLuaEngine = dynamic_cast<CCLuaEngine *>(pEngine);
if( pLuaEngine == NULL )
return;
CCLuaStack *pLuaStack = pLuaEngine->getLuaStack();
if( pLuaStack == NULL )
return;
lua_State *L = pLuaStack->getLuaState();
lua_getglobal(L, "g_resetAll");
lua_call(L, 0, 1);
lua_pop(L, 1);
CCLOG("LLLLLLLL");
// CCScriptEngineManager::sharedManager()->removeScriptEngine();
// CCLOG("84-2");
// CCLuaEngine *pEngine = CCLuaEngine::defaultEngine();
// CCLOG("84-3");
// CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine);
// CCLOG("84-4");
// ptola::script::CLuaClassSupport::initialize(pEngine);
// CCLOG("84-5");
CCDirector *pDirector = CCDirector::sharedDirector();
CCLOG("84-1");
int nLevelLimit = CCUserDefault::sharedUserDefault()->getIntegerForKey("LevelResource", 0);
CCLOG("84-6");
pDirector->popToRootScene();
CCLOG("84-7");
CCScene *pUpdateScene = CGameUpdateScene::scene(nLevelLimit);
CCLOG("84-8 %d", pUpdateScene);
pDirector->pushScene(pUpdateScene);
CCLOG("84-9");
pDirector->setShowBundleVersion(true);
CCLOG("84-10");
}
CCLOG("EXECUTE_LUA_COMMAND: %d", nCommand);
return;
}