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


C++ CCScene::init方法代码示例

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


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

示例1: CCScene

CCScene *CCScene::create()
{
    CCScene *pRet = new CCScene();
    if (pRet && pRet->init())
    {
        pRet->autorelease();
        return pRet;
    }
    else
    {
        CC_SAFE_DELETE(pRet);
        return NULL;
    }
}
开发者ID:SD216814,项目名称:quick-cocos2d-x,代码行数:14,代码来源:CCScene.cpp

示例2: LoadingScene

CCScene *LoadingScene::scene()
{
    LoadingScene *layer = new LoadingScene();
    if (!layer->init()) {
        delete layer;
        return 0;
    }
    layer->autorelease();

    CCScene *scene = new CCScene();
    scene->init();
    scene->addChild(layer);

    return scene;
}
开发者ID:sergey-shambir,项目名称:blocksdemo,代码行数:15,代码来源:LoadingScene.cpp

示例3:

CCScene * GameLayer::scene() {
	CCScene *scene = CCScene::create();
	if (scene && scene->init()) {
		if (scene) {
			/*-- 背景 --*/
			scene->addChild(BgLayer::create());
			GameLayer *layer = GameLayer::create();
			scene->addChild(layer, TAG_LAYER_GAME);
			scene->addChild(layer->createPauseButtonLayer());
		}
		return scene;
	} else {
		CC_SAFE_DELETE(scene);
		return NULL;
	}

}
开发者ID:beforeeight,项目名称:sort,代码行数:17,代码来源:GameScene.cpp

示例4: goNextScene

void SceneManager::goNextScene()
{
    CCScene * sceneToRun = NULL;

	m_prevSceneID	= m_curSceneID;
	m_curSceneID	= m_nextSceneID;

    switch (m_nextSceneID)
    {
        case kStartScene:
            sceneToRun = new StartScene;
            break;
       case kPcSelectScene:
            sceneToRun = new PcSelectScene;
            break;
		case kWorldMapScene:
			sceneToRun = new WorldMapScene;
			break;
		case kStageSelectScene:
			sceneToRun = new StageSelectScene;
			break;
		case kBattleScene:
            sceneToRun = new BattleScene;
            break;
        case kAchievementScene:
            sceneToRun = new AchievementScene;
            break;
        case kRankScene:
//            sceneToRun = [RankScene node];
            break;
    }
	sceneToRun->init();
	curScene = sceneToRun;

    if (CCDirector::sharedDirector()->getRunningScene() == NULL)
    {
        CCDirector::sharedDirector()->runWithScene(sceneToRun);
    }
    else
    {
		CCDirector::sharedDirector()->replaceScene(CCTransitionSlideInL::create(0.5, sceneToRun));
	}

//	[[CCDirector sharedDirector].view setUserInteractionEnabled:TRUE];
}
开发者ID:ofcbj,项目名称:test,代码行数:45,代码来源:SceneManager.cpp

示例5:

CCScene * MainLayer::scene()
{
	CCScene *scene = CCScene::create();
	if (scene && scene->init())
	{
		if (scene)
		{
			/*-- 背景 --*/
			CCLayer *bgLayer = BgLayer::create();
			scene->addChild(bgLayer);
			MainLayer *layer = MainLayer::create();
			scene->addChild(layer);
		}
		return scene;
	}
	else
	{
		CC_SAFE_DELETE(scene);
		return NULL;
	}
}
开发者ID:beforeeight,项目名称:bump,代码行数:21,代码来源:MainLayer.cpp

示例6: applicationDidFinishLaunching

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

    // 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 = new PuzzleScene;
    pScene->init();

    // run
    pDirector->runWithScene(pScene);

    return true;
}
开发者ID:fU9ANg,项目名称:GLdemos,代码行数:21,代码来源:AppDelegate.cpp

示例7: initScenes

//------------------------------------------------------------------------------
bool initScenes(CCScene * pScene, CCScene** inScene, CCScene ** outScene)
{
    CCAssert(pScene != NULL, "Argument scene must be non-nil");

    CCScene * pOutScene = (CCScene*)CCDirector::sharedDirector()->getNotificationNode();
    if (pOutScene == NULL)
    {
        pOutScene = CCScene::create();
        pOutScene->init();
        pOutScene->onEnter();
    }
    
    pOutScene->retain();
    pScene->retain();

    CCAssert(pScene != pOutScene, "Incoming scene must be different from the outgoing scene");
    
    *inScene = pScene;
    *outScene = pOutScene;

    return true;
}
开发者ID:sbc100,项目名称:OpenQuick,代码行数:23,代码来源:QTransition.cpp


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