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


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

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


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

示例1: init

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);
}
开发者ID:BellyWong,项目名称:CocostudioDemo,代码行数:16,代码来源:SceneManager.cpp

示例2: while

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;
}
开发者ID:k8802810,项目名称:cocos2dx_tank,代码行数:16,代码来源:LoginScene.cpp

示例3:

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

示例4: while

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;
}
开发者ID:liuyuyefz,项目名称:GreTest,代码行数:16,代码来源:S2TestScene.cpp

示例5: 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;
}
开发者ID:honggezi18,项目名称:my-cocos2d-x-learn,代码行数:16,代码来源:HelloWorldScene.cpp

示例6:

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;
}
开发者ID:dfwxb,项目名称:cocos_lesson2,代码行数:16,代码来源:T05CCLabelTTf.cpp

示例7: scene

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;
}
开发者ID:huangmaowwm,项目名称:miwu,代码行数:16,代码来源:MouseGameScene.cpp

示例8: 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;
}
开发者ID:mjssw,项目名称:myproj,代码行数:16,代码来源:TetrisRoomScene.cpp

示例9: 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;
}
开发者ID:fordream,项目名称:wanghe-project,代码行数:16,代码来源:SysMenu.cpp

示例10: 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;
}
开发者ID:DionysosLai,项目名称:Coco2d-xRes,代码行数:16,代码来源:define+a+CCScene+instance.cpp

示例11: 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;
}
开发者ID:ChengYe,项目名称:cocosjson,代码行数:16,代码来源:PageScene.cpp

示例12: itm_startCallback

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);
	}
}
开发者ID:crocodev,项目名称:Croco,代码行数:16,代码来源:GroupCustomization.cpp

示例13: sceneWithString

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;
}
开发者ID:mcodegeeks,项目名称:OpenKODE-Framework,代码行数:17,代码来源:Ch5_SwitchingScenes.cpp

示例14: clickMultipleMenu

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);
    
    
}
开发者ID:342261733,项目名称:cocos2d-x,代码行数:17,代码来源:StartLayer.cpp

示例15: while

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;
}
开发者ID:liuyuyefz,项目名称:GreTest,代码行数:17,代码来源:S3PracticeScene.cpp


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