当前位置: 首页>>代码示例>>C++>>正文


C++ CCDirector::pushScene方法代码示例

本文整理汇总了C++中CCDirector::pushScene方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDirector::pushScene方法的具体用法?C++ CCDirector::pushScene怎么用?C++ CCDirector::pushScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCDirector的用法示例。


在下文中一共展示了CCDirector::pushScene方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
	// initialize director
	CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());

    // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
    // pDirector->enableRetinaDisplay(true);

	// sets landscape mode
	// pDirector->setDeviceOrientation(kCCDeviceOrientationLandscapeLeft);


	// set FPS. the default value is 1.0/60 if you don't call this
	pDirector->setAnimationInterval(1.0 / 60);

    CCUserDefault *save=CCUserDefault::sharedUserDefault(); 
  
    pDirector->pushScene(Tutorial::scene());
    if(save->getBoolForKey("tutorialed")==true) 
    { 
        pDirector->pushScene(Play::scene());
    }
	return true;
}
开发者ID:xdxttt,项目名称:ht,代码行数:25,代码来源:AppDelegate.cpp

示例2: onJoinGame

void CCLobbyView::onJoinGame( bool isGameMaster )
{
    CocosNetworkLogic* network = CocosNetworkLogic::getInstance();
    network->setDidCreateGame(isGameMaster);
    CCDirector* director = CCDirector::sharedDirector();
    CCScene* scene = GameLayer::scene();
    director->pushScene( scene );
}
开发者ID:kaznog,项目名称:t09,代码行数:8,代码来源:CCLobbyView.cpp

示例3: push

void SceneManager::push(CCLayer* layer)
{
	CCDirector* director = CCDirector::sharedDirector();
	CCScene* newScene = SceneManager::wrap(layer);
	if (director->getRunningScene()) //这句话 很有可能写的不对啊  有哪位大侠知道怎么写 告知下...   
	{  
		director->pushScene( newScene);
	}
}
开发者ID:wyklion,项目名称:Flyup,代码行数:9,代码来源:SceneManager.cpp

示例4: ccTouchBegan

bool MenuLayer::ccTouchBegan(CCTouch* pTouch, CCEvent* pEvent){
	CCScene* mScene = MapScene::create();
	CCScene* eScene = EquipScene::create();
	CCTransitionScene *reScene = NULL;
	CCDirector* pDirector = CCDirector::sharedDirector();
	CCRect battleRect = this->labelList[0]->boundingBox();
	CCRect equipRect = this->labelList[1]->boundingBox();
	
	if (battleRect.CCRect::containsPoint(this->getParent()->convertTouchToNodeSpace(pTouch)) == true){
		reScene = CCTransitionCrossFade::create(1.0f, mScene);
	}
	else if (equipRect.CCRect::containsPoint(this->getParent()->convertTouchToNodeSpace(pTouch)) == true){
		reScene = CCTransitionCrossFade::create(1.0f, eScene);
	}
	else{
		reScene = NULL;
	}

	if (reScene){
		pDirector->pushScene(reScene);
	}

	return false;
}
开发者ID:houssemeddinelassoued,项目名称:PuppetWars,代码行数:24,代码来源:MenuLayer.cpp

示例5: applicationDidFinishLaunching

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
    
    CCEGLView::sharedOpenGLView()->setDesignResolutionSize(960, 640, kResolutionExactFit);
    // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
//     pDirector->enableRetinaDisplay(true);

    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it's an autorelease object
    //CCScene *pScene = sgs::scene::PlayerTable::scene(8);//MainLayer::scene();//
    //CCScene *pScene = sgs::scene::Loading::scene();
    
    pDirector->pushScene(MainLayer::scene());//HelloWorld::scene());
    // run
    return true;
}
开发者ID:coderHsc,项目名称:sanguosha,代码行数:24,代码来源:AppDelegate.cpp

示例6: 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;
}
开发者ID:jindaw,项目名称:game_sources,代码行数:80,代码来源:LoginVerifyLua_Android.cpp

示例7: passAndPlayCallback

void MainMenu::passAndPlayCallback( cocos2d::CCObject* sender )
{    
    CCDirector* director = CCDirector::sharedDirector();
    CCScene* gameScene = PMSGameScene::create();
    director->pushScene( gameScene );
}
开发者ID:georgemguy,项目名称:Cocos2d-x_Photon_MultiPlatform_Test,代码行数:6,代码来源:MainMenu.cpp


注:本文中的CCDirector::pushScene方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。