本文整理汇总了C++中CCBReader::createSceneWithNodeGraphFromFile方法的典型用法代码示例。如果您正苦于以下问题:C++ CCBReader::createSceneWithNodeGraphFromFile方法的具体用法?C++ CCBReader::createSceneWithNodeGraphFromFile怎么用?C++ CCBReader::createSceneWithNodeGraphFromFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCBReader
的用法示例。
在下文中一共展示了CCBReader::createSceneWithNodeGraphFromFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: go
bool CGameSceneManager::go(SCENE_TYPE st)
{
Scene* scene = nullptr;
switch (st)
{
case ST_LOGIN:
{
CCBReader* pReader = new CCBReader(NodeLoaderLibrary::getInstance());
scene = pReader->createSceneWithNodeGraphFromFile("login_layer.ccbi");
delete pReader;
break;
}
case ST_LOBBY:
{
CCBReader* pReader = new CCBReader(NodeLoaderLibrary::getInstance());
scene = pReader->createSceneWithNodeGraphFromFile("lobby_layer.ccbi");
delete pReader;
break;
}
case ST_FORMATION:
{
scene = Scene::create();
scene->addChild(CFormationLayer::create());
break;
}
case ST_BATTLE_FIELD:
{
scene = Scene::create();
scene->addChild(CBattleFieldLayer::create()); // call init in create()
break;
}
case ST_SETTINGS:
break;
case ST_HOME:
{
CCBReader* pReader = new CCBReader(NodeLoaderLibrary::getInstance());
scene = pReader->createSceneWithNodeGraphFromFile("home_layer.ccbi");
delete pReader;
break;
}
default:
break;
}
if (scene)
{
Director* pDirector = Director::getInstance();
if (pDirector->getRunningScene())
{
TransitionFade* trans = TransitionFade::create(.2f, scene, Color3B(255, 255, 255));
pDirector->replaceScene(trans);
}
else
{
pDirector->runWithScene(scene);
}
}
return true;
}
示例2: getMainScene
CCScene* MainScene::getMainScene() {
NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::sharedNodeLoaderLibrary();
ccNodeLoaderLibrary->registerCCNodeLoader("MainScene", MainSceneLoader::loader());
CCBReader *ccbReader = new CCBReader(ccNodeLoaderLibrary);
return ccbReader->createSceneWithNodeGraphFromFile("ccb/MainScreen.ccbi");
}
示例3: getStoreBScene
CCScene* StoreBScene::getStoreBScene() {
CCNodeLoaderLibrary * ccNodeLoaderLibrary = CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary();
ccNodeLoaderLibrary->registerCCNodeLoader("StoreBScene", StoreBSceneLoader::loader());
CCBReader *ccbReader = new CCBReader(ccNodeLoaderLibrary);
ccbReader->retain();
CCScene *pScene = ccbReader->createSceneWithNodeGraphFromFile("ccb/StoreBScene.ccbi");
ccbReader->release();
return pScene;
}
示例4: scene
CCScene* BattleScene::scene(){
CCNodeLoaderLibrary *nodeLoaderLibrary = CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary();
CCBReader *reader = new CCBReader(nodeLoaderLibrary);
// 'scene' is an autorelease object.
CCScene *scene = reader->createSceneWithNodeGraphFromFile("BattleScene.ccbi");
reader->release();
// return the scene
return scene;
}