本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}