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


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

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


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

示例1: menuSelector

void MainMenuScene::menuSelector(CCObject* pSender)
{
    CCDirector *pDirector = CCDirector::sharedDirector();
    CCTransitionFade *tscene;
    SpriteButton *selectedOpt = (SpriteButton*) pSender;
    CCScene *scene;
    switch (selectedOpt->getTag()) {
        case 1:
            scene = CategoryScene::create();
            tscene = CCTransitionFade::create(0.5, scene);
            pDirector->replaceScene(tscene);
            break;
        case 2:
            scene = ProfilaScene::create();
            tscene = CCTransitionFade::create(0.5, scene);
            pDirector->replaceScene(tscene);
            break;
        case 3:
            #ifdef __APPLE__
                CCApplication::sharedApplication()->openURL("http://auskalo.net/honi-buruz/");
            #endif
            #ifdef ANDROID
                CCApplication::sharedApplication()->openURLJNI("http://auskalo.net/honi-buruz/");
            #endif
            break;
        default:
            break;
    }
    
}
开发者ID:aandroiderr,项目名称:Auskalo,代码行数:30,代码来源:MainMenuScene.cpp

示例2: loginEnd

void LoginScene::loginEnd(bool suc, std::string s, void*param)
{
    if(suc == false){
        return;
    }
    
	UserService* pUserService = (UserService*)ServiceCenter::getInstance()->getService(ServiceCenter::USER_SERVICE);
    
    NetLogin loginData = pUserService->analyzeLoginRect(s);
    if(loginData.status == 1){
    //登陆成功
        //保存本地用户名
        CCUserDefault::sharedUserDefault()->setStringForKey("loginName", username->getStringValue());
        CCUserDefault::sharedUserDefault()->setStringForKey("passWord", md5(password->getStringValue()));
        CCUserDefault::sharedUserDefault()->flush();
        
        
        //Logic::getInstance()->setUID(loginData.userid);
        pUserService->getUser()->uid = loginData.userid;
        //初始化登录信息
        CCDirector* pDirector = CCDirector::sharedDirector();
        if(loginData.isPerfect == 1){
            CCLog("loginEnd finish");
            CCScene* pScene = WorldCup::scene();
            //pDirector->replaceScene(pScene);
            CCScene *ns = CCTransitionSlideInR::create(transTime, pScene);
            
            pDirector->replaceScene(ns);
            
        }else{
            CCLog("Userid::%d",loginData.userid);
            CCUserDefault::sharedUserDefault()->setIntegerForKey("setPerfectFormId", loginData.userid);
            CCUserDefault::sharedUserDefault()->flush();
            
            CCScene* pScene = RegistScene::scene();
            
            pDirector->replaceScene(getTransScene(pScene));
            
        }
        
        
    }else{
    //登陆失败
        CCLog("Login fail!");
        CCMessageBox("账号或密码错误!", "提示");
        //删除本地用户名
        CCUserDefault::sharedUserDefault()->setStringForKey("loginName", "");
        CCUserDefault::sharedUserDefault()->flush();
        
        //Logic::getInstance()->setLoginName("");
        
        refurbishScene();
    }
}
开发者ID:liyonghelpme,项目名称:ballpartyAllCode,代码行数:54,代码来源:LoginScene.cpp

示例3: menuSelector

void MainMenuScene::menuSelector(CCObject* pSender)
{
    SpriteButton *selectedOpt = (SpriteButton*) pSender;
    CCScene *scene;
    switch (selectedOpt->getTag()) {
        case 1:
            scene = CategoryScene::create();
            break;
        case 2:
            scene = ProfilaScene::create();
            break;
        case 3:
            #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
                openURLJNI("http://jakina.eu/");
            #else
                CCApplication::sharedApplication()->openURL("http://jakina.eu/");
            #endif
            break;
        default:
            break;
    }
    CCDirector *pDirector = CCDirector::sharedDirector();
    CCTransitionFade *tscene = CCTransitionFade::create(0.5, scene);
    pDirector->replaceScene(tscene);
}
开发者ID:axierjhtjz,项目名称:Jakina-mobile,代码行数:25,代码来源:MainMenuScene.cpp

示例4: menuChangeUiEditCallBack

 void MenuLayerMainMenu::menuChangeUiEditCallBack(CCObject *pSender){
	 CCDirector* director = CCDirector::sharedDirector();
	 director->purgeCachedData();
	 CCScene* ccscene = CCScene::create();
	 ccscene->addChild(new UiEditLayer());
	 director->replaceScene(ccscene);
 }
开发者ID:uestczhuyan,项目名称:cocos2d-game_demo,代码行数:7,代码来源:MenuTest.cpp

示例5: menuStartAirGame

 void MenuLayerMainMenu::menuStartAirGame(CCObject* pSender){
	 CCDirector* director = CCDirector::sharedDirector();
	 director->purgeCachedData();
	 CCScene* ccscene = ShotPlanSecene::create();
	 CCLOG ("%s \n", "menuStartAirGame");
	 director->replaceScene(ccscene);
 }
开发者ID:uestczhuyan,项目名称:cocos2d-game_demo,代码行数:7,代码来源:MenuTest.cpp

示例6: menuStartGame

 void MenuLayerMainMenu::menuStartGame(CCObject* pSender){
	 CCDirector* director = CCDirector::sharedDirector();
	 director->purgeCachedData();
	 CCScene* ccscene = CCScene::create();
	 ccscene->addChild(BearRunScene::create());
	 director->replaceScene(ccscene);
 }
开发者ID:uestczhuyan,项目名称:cocos2d-game_demo,代码行数:7,代码来源:MenuTest.cpp

示例7: gameover

void MainLayer::gameover()
{
	CCDirector* pDirector = CCDirector::sharedDirector();
	CCScene *pScene = FinishLayer::scene();
	CCScene *reScene = CCTransitionFadeDown::create(0.5f, pScene);
	pDirector->replaceScene(reScene);
}
开发者ID:beforeeight,项目名称:bump,代码行数:7,代码来源:MainLayer.cpp

示例8: SetLoadingScene

void GSceneSelector::SetLoadingScene()
{
	mpLoadingScene = GLoadingScene::CreateLoadingScene();
	CCDirector* pDirector = CCDirector::sharedDirector();
	if( mpLoadingScene )
		pDirector->replaceScene( mpLoadingScene );
}
开发者ID:issamux,项目名称:WebGame,代码行数:7,代码来源:GSceneSelector.cpp

示例9: go

void TFBaseLayer::go(TFBaseLayer* pLayer)
{
    if (pLayer)
    {
        TRANSIT_LAYER->setFromLayer(this);
        TRANSIT_LAYER->setToLayer(pLayer);
    }
    else
    {
        TRANSIT_LAYER->setFromLayer(NULL);
        TRANSIT_LAYER->setToLayer(this);
    }

    CCDirector* pDirector = CCDirector::sharedDirector();
    CCScene* pScene = this->wrap(TRANSIT_LAYER);
    
    if (pDirector->getRunningScene())
    {
        pDirector->replaceScene(pScene);
    }
    else
    {
        pDirector->runWithScene(pScene);
    }
}
开发者ID:jobine,项目名称:TheForce,代码行数:25,代码来源:TFBaseLayer.cpp

示例10: playClicked

void MenuScene::playClicked(CCObject *sender)
{
    UniverseScene *scene = UniverseScene::create();
    CCDirector *pDirector = CCDirector::sharedDirector();
    CCTransitionFade *tscene = CCTransitionFade::create(0.5, scene);
    pDirector->replaceScene(tscene);
}
开发者ID:ikermendi,项目名称:Ikasitz,代码行数:7,代码来源:MenuScene.cpp

示例11: settingsClicked

void MenuScene::settingsClicked(CCObject *sender)
{
    SettingScene *scene = SettingScene::create();
    scene->setSceneReturnType(kReplaScene);
    CCDirector *pDirector = CCDirector::sharedDirector();
    CCTransitionFade *tscene = CCTransitionFade::create(0.5, scene);
    pDirector->replaceScene(tscene);
}
开发者ID:ikermendi,项目名称:Ikasitz,代码行数:8,代码来源:MenuScene.cpp

示例12: backClick

void GameLayer::backClick(cocos2d::CCObject *sender)
{
    CCLog("后退按钮");
    CCScene *ss = CCScene::create();//问题果然出在这里:create != new init
    StartLayer *start = StartLayer::create();
    ss->addChild(start);
    CCDirector *d = CCDirector::sharedDirector();
    d->replaceScene(ss);   

}
开发者ID:342261733,项目名称:cocos2d-x,代码行数:10,代码来源:GameLayer.cpp

示例13: go

void SceneManager::go(CCLayer * layer){
    CCDirector *director = CCDirector::sharedDirector();
    CCScene *newScene = SceneManager::wrap(layer);
    if (!director->isPaused()) {
        director->replaceScene(newScene);
    }
    else {
        director->runWithScene(newScene);
    }
}
开发者ID:JsonYu-china,项目名称:cocos2dx-choice,代码行数:10,代码来源:SceneManager.cpp

示例14: menuStartCallback

void Menu::menuStartCallback(CCObject* pSender)
{


	CCDirector *pDirector = CCDirector::sharedDirector();


	CCScene *pScene = GameScene::scene();

	// run
	pDirector->replaceScene(pScene);
}
开发者ID:amrzagloul,项目名称:BBB,代码行数:12,代码来源:MenuScene.cpp

示例15: registerPress

void LoginScene::registerPress(CCObject *pSender,TouchEventType type)
{
	if(type == TOUCH_EVENT_ENDED){
        
        CCDirector* pDirector = CCDirector::sharedDirector();
        
        //进入注册页面
        CCScene* pScene = RegistScene::scene();
        pDirector->replaceScene(pScene);

	}
    
}
开发者ID:liyonghelpme,项目名称:ballpartyAllCode,代码行数:13,代码来源:LoginScene.cpp


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