void SceneManager::init() { scenes[SC_MENU] = MenuLayer::create(); scenes[SC_PLAY] = HelloWorld::create(); CCScene* scene = CCScene::create(); for (int i=0; i<SCENE_MAX; i++) { if (scenes[i] != NULL) { scene->addChild(scenes[i]); scenes[i]->setVisible(false); } } CCDirector::sharedDirector()->runWithScene(scene); }
CCScene *Login::scene() { CCScene *scene = NULL; do { // 'scene' is an autorelease object scene = CCScene::create(); CC_BREAK_IF(! scene); // 'layer' is an autorelease object Login *layer = Login::create(); CC_BREAK_IF(! layer); // add layer as a child to scene scene->addChild(layer); } while (0); // return the scene return scene; }
CCScene *C553_Android_Login::scene() { C553_Android_Login *pLayer = C553_Android_Login::create(); if( pLayer != NULL ) { CCScene *pScene = CCScene::create(); if( pScene != NULL ) { pScene->addChild(pLayer); return pScene; } CC_SAFE_DELETE(pLayer); return NULL; } return NULL; }
CCScene* S2TestMain::scene() { CCScene * scene = NULL; do { scene = CCScene::create(); CC_BREAK_IF(! scene); S2TestMain *layer = S2TestMain::create(); CC_BREAK_IF(! layer); scene->addChild(layer); } while (0); return scene; }
CCScene* HelloWorld::scene() { CCScene * scene = NULL; do { scene = CCScene::node(); CC_BREAK_IF(! scene); HelloWorld *layer = HelloWorld::node(); CC_BREAK_IF(! layer); scene->addChild(layer); } while (0); return scene; }
CCScene* T05CCLabelTTf::scene() { CCScene* pRet = CCScene::create(); T05CCLabelTTf* pLayer = T05CCLabelTTf::create(); if (pRet && pLayer) { pRet->addChild(pLayer); } else { CC_SAFE_DELETE(pLayer); CC_SAFE_DELETE(pRet); } return pRet; }
CCScene* MouseGameScene::scene() { CCScene* scene = CCScene::create(); sharedInstance = GameSceneLoader::load(); sharedInstance->background = MouseBackgroundLoader::load(); sharedInstance->status = StatusLoader::load(); sharedInstance->backgroundLayer->addChild(sharedInstance->background, 0, 101); sharedInstance->statusLayer->addChild(sharedInstance->status, 2, 102); sharedInstance->menu = MouseMenuLoader::load(); sharedInstance->menuLayer->addChild(sharedInstance->menu, 1, 103); scene->addChild(sharedInstance); return scene; }
CCScene* CTetrisRoomScene::scene() { CCScene *scene = NULL; do { scene = CCScene::create(); CC_BREAK_IF(! scene); CTetrisRoomScene *layer = CTetrisRoomScene::create(); CC_BREAK_IF(! layer); scene->addChild(layer); } while (0); return scene; }
CCScene* SysMenu::scene() { CCScene* scene = NULL; do { scene = CCScene::create(); CC_BREAK_IF(!scene); CCLayer* layer = SysMenu::create(); CC_BREAK_IF(!layer); scene->addChild(layer); } while (0); return scene; }
CCScene* BackScreen::scene() { // 'scene' is an autorelease object /// 新建场景类实例 CCScene *scene = CCScene::create(); // 'layer' is an autorelease object /// 定义布景层 BackScreen *layer = BackScreen::create(); // add layer as a child to scene 将布景层加入场景中 scene->addChild(layer); // return the scene return scene; }
CCScene* PageScene::scene() { CCScene* pScene = NULL; do { pScene = CCScene::create(); CC_BREAK_IF(!pScene); PageScene* pLayer = PageScene::create(); CC_BREAK_IF(!pLayer); pScene->addChild(pLayer); } while (0); return pScene; }
void GroupCustomization::itm_startCallback(CCObject* pSender) { int check = CheckGroupNames(m_GameMode); //if exists fails move to fail page if(check) pScrollLayer->moveToPage(check); else { CCScene* pScene = CCScene::node(); CCLayer* pLayer = new ActionLayer(m_GameMode,m_groups[0],m_groups[1],m_groups[2],m_groups[3]); pScene->addChild(pLayer); CCScene* s = CCTransitionFade::transitionWithDuration((1.2f), pScene); pLayer->release(); CCDirector::sharedDirector()->replaceScene(s); } }
CCScene* TreeSceneMenu::sceneWithString ( const KDchar* szStr ) { TreeSceneMenu* pLayer = new TreeSceneMenu ( ); if ( pLayer && pLayer->initWithString ( szStr ) ) { CCScene* pScene = CCScene::create ( ); pScene->addChild ( pLayer ); pLayer->autorelease ( ); return pScene; } CC_SAFE_DELETE ( pLayer ); return KD_NULL; }
void StartLayer::clickMultipleMenu(cocos2d::CCObject *sender) { CCLog("单击了双人游戏"); MutiGameLayer *mg = MutiGameLayer::create(); CCScene *s = CCScene::create(); s->addChild(mg); // mg->release(); CCDirector *d = CCDirector::sharedDirector(); // CCTransitionCrossFade *anni = CCTransitionCrossFade::create(1.0f, s); CCTransitionRotoZoom *anni = CCTransitionRotoZoom::create(1.0f, s); // s->release(); d->replaceScene(anni); }
CCScene* S3PracticeScene::scene() { CCScene * scene = NULL; do { scene = CCScene::create(); CC_BREAK_IF(! scene); S3PracticeScene *layer = S3PracticeScene::create(); CC_BREAK_IF(! layer); scene->addChild(layer); } while (0); return scene; }
CCScene* AdventureModeMainClass::createScene() { CCScene* scene = NULL; do { scene = CCScene::create(); CC_BREAK_IF(!scene); AdventureModeMainClass* adventure = AdventureModeMainClass::create(); CC_BREAK_IF(!adventure); scene->addChild(adventure); } while (0); return scene; }
CCScene* JS_Result::scene(int nGameLevel, int nBGIndex, int nPlayTime) { CCScene * scene = NULL; do { scene = CCScene::create(); CC_BREAK_IF(! scene); JS_Result *layer = JS_Result::create(nGameLevel, nBGIndex, nPlayTime); CC_BREAK_IF(! layer); scene->addChild(layer); } while (0); return scene; }
CCScene* HelloWorld::scene() { // 'scene' is an autorelease object CCScene *scene = CCScene::node(); // 'layer' is an autorelease object HelloWorld *layer = HelloWorld::node(); // add layer as a child to scene scene->addChild(layer); // return the scene return scene; }
CCScene *C553_SDK::scene() { CCScene *pScene = CCScene::create(); if( pScene != NULL ) { C553_SDK *pSdk = C553_SDK::create(); if( pSdk != NULL ) { pScene->addChild(pSdk); } else { CC_SAFE_DELETE(pScene); } } return pScene; }
void S65ShowVideo::refreshDownLoadingData(bool isCompleted) { if (isCompleted) { string detailClassName ="S"+PersonalApi::convertIntToString(AppDelegate::S1NaviSelected) +"ShowVideo"; string currentClassName(detailClassName.c_str()); string version = currentClassName+"version"; string newVersion = currentClassName+"newVersion"; CCUserDefault::sharedUserDefault()->setStringForKey(version.c_str(), CCUserDefault::sharedUserDefault()->getStringForKey(newVersion.c_str())); } CCScene *newScene = CCScene::create(); newScene->addChild(S65ShowVideo::create()); CCDirector::sharedDirector()->replaceScene(CCTransitionFade::create(0.0f, newScene)); }
bool AppDelegate::applicationDidFinishLaunching() { // As an example, load config file // XXX: This should be loaded before the Director is initialized, // XXX: but at this point, the director is already initialized CCConfiguration::sharedConfiguration()->loadConfigFile("configs/config-example.plist"); // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize(); CCSize designSize = CCSizeMake(480, 320); CCFileUtils* pFileUtils = CCFileUtils::sharedFileUtils(); std::vector<std::string> searchPaths; if (screenSize.height > 320) { CCSize resourceSize = CCSizeMake(960, 640); searchPaths.push_back("hd"); searchPaths.push_back("hd/scenetest"); pDirector->setContentScaleFactor(resourceSize.height/designSize.height); } else { searchPaths.push_back("scenetest"); } pFileUtils->setSearchPaths(searchPaths); #if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionShowAll); #else CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder); #endif CCScene * pScene = CCScene::create(); CCLayer * pLayer = new TestController(); pLayer->autorelease(); pScene->addChild(pLayer); pDirector->runWithScene(pScene); return true; }
/** * 静态方法,创建一个场景,并将自定义的HelpView布景层加入到该场景中 * return 返回创建好的场景对象 */ CCScene* HelpView::CreateScene() { CCScene* scene = CCScene::create() ; HelpView* msgView = new HelpView() ; // HelpView::create() ; if (msgView && msgView->init()) { msgView->init() ; } msgView->autorelease() ; scene->addChild(msgView) ; return scene ; }
CCScene* WelcomeScene::scene(){ CCScene* scene = NULL; do{ scene = CCScene::create(); CC_BREAK_IF(!scene); instance = WelcomeScene::create(); CC_BREAK_IF(!instance); scene->addChild(instance); }while(0); return scene; }
CCScene *CMi_Login::scene() { CCScene *pScene = CCScene::create(); if( pScene != NULL ) { CMi_Login *pLogin = CMi_Login::create(); if( pLogin != NULL ) { pScene->addChild(pLogin); } else { CC_SAFE_DELETE(pScene); } } return pScene; }
cocos2d::CCScene* Settings::scene() { // 'scene' is an autorelease object CCScene *scene = CCScene::create(); // 'layer' is an autorelease object Settings *layer = Settings::create(); // add layer as a child to scene CCCallFunc* back = CCCallFunc::create(layer, callfunc_selector(SceneStyle::simulateBackClick)); BackgroundHolder::backgroundSwitchTo(scene,back); scene->addChild(layer); // return the scene return scene; }
CCScene* FirstScene::Scene() { CCScene* pScene = NULL; do { pScene = CCScene::create(); CC_BREAK_IF(! pScene); FirstScene* pFirstScene = FirstScene::create(); CC_BREAK_IF(! pFirstScene); pScene->addChild(pFirstScene); } while (0); return pScene; }
CCScene* Loading::scene() { // 'scene' is an autorelease object CCScene *scene = CCScene::create(); CCLayer* layer = NULL; if(LevelSelect::getCurrentLevel() <= 6) layer = new TutorialLoading(LevelSelect::getCurrentLevel()+1); else layer = new Loading(); // add layer as a child to scene scene->addChild(layer); layer->release(); return scene; }
/** * 静态方法,创建一个场景,并将自定义的ActivityView布景层加入到该场景中 * return 返回创建好的场景对象 */ CCScene* ActivityView::CreateScene() { CCScene* scene = CCScene::create() ; ActivityView* msgView = new ActivityView() ; // ActivityView::create() ; if (msgView && msgView->init()) { msgView->init() ; } msgView->autorelease() ; scene->addChild(msgView) ; return scene ; }
CCScene* AboutLayer::scene(){ CCScene* sc = NULL; do { sc = CCScene::create(); CC_BREAK_IF( !sc ); AboutLayer* layer = AboutLayer::create(); CC_BREAK_IF( !layer ); sc->addChild( layer ); } while (0); return sc; }
void S22PicDetail::refreshDownLoadingData(bool isCompleted) { AppDelegate::loadingLabel->setString(""); if (isCompleted) { string detailClassName ="S2"+PersonalApi::convertIntToString(AppDelegate::S2SelectedScene)+PersonalApi::convertIntToString(AppDelegate::S2LeftSelected)+"ZiBuLei"; string currentClassName(detailClassName.c_str()); string version = currentClassName+"version"; string newVersion = currentClassName+"newVersion"; CCUserDefault::sharedUserDefault()->setStringForKey(version.c_str(), CCUserDefault::sharedUserDefault()->getStringForKey(newVersion.c_str())); } CCScene *newScene = CCScene::create(); newScene->addChild(S22PicDetail::create()); CCDirector::sharedDirector()->replaceScene(CCTransitionFade::create(0.0f, newScene)); }