本文整理汇总了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;
}
}
示例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();
}
}
示例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);
}
示例4: menuChangeUiEditCallBack
void MenuLayerMainMenu::menuChangeUiEditCallBack(CCObject *pSender){
CCDirector* director = CCDirector::sharedDirector();
director->purgeCachedData();
CCScene* ccscene = CCScene::create();
ccscene->addChild(new UiEditLayer());
director->replaceScene(ccscene);
}
示例5: menuStartAirGame
void MenuLayerMainMenu::menuStartAirGame(CCObject* pSender){
CCDirector* director = CCDirector::sharedDirector();
director->purgeCachedData();
CCScene* ccscene = ShotPlanSecene::create();
CCLOG ("%s \n", "menuStartAirGame");
director->replaceScene(ccscene);
}
示例6: menuStartGame
void MenuLayerMainMenu::menuStartGame(CCObject* pSender){
CCDirector* director = CCDirector::sharedDirector();
director->purgeCachedData();
CCScene* ccscene = CCScene::create();
ccscene->addChild(BearRunScene::create());
director->replaceScene(ccscene);
}
示例7: gameover
void MainLayer::gameover()
{
CCDirector* pDirector = CCDirector::sharedDirector();
CCScene *pScene = FinishLayer::scene();
CCScene *reScene = CCTransitionFadeDown::create(0.5f, pScene);
pDirector->replaceScene(reScene);
}
示例8: SetLoadingScene
void GSceneSelector::SetLoadingScene()
{
mpLoadingScene = GLoadingScene::CreateLoadingScene();
CCDirector* pDirector = CCDirector::sharedDirector();
if( mpLoadingScene )
pDirector->replaceScene( mpLoadingScene );
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例14: menuStartCallback
void Menu::menuStartCallback(CCObject* pSender)
{
CCDirector *pDirector = CCDirector::sharedDirector();
CCScene *pScene = GameScene::scene();
// run
pDirector->replaceScene(pScene);
}
示例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);
}
}