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


C++ CCBReader::createSceneWithNodeGraphFromFile方法代码示例

本文整理汇总了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;
}
开发者ID:Gamex,项目名称:GameX,代码行数:59,代码来源:CGameSceneManager.cpp

示例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");
}
开发者ID:ElliotMebane,项目名称:cocos2dx-store-example,代码行数:9,代码来源:MainScene.cpp

示例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;
}
开发者ID:asmodehn,项目名称:cocos2dx-store-example,代码行数:11,代码来源:StoreBScene.cpp

示例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;
}
开发者ID:killing333,项目名称:Colors,代码行数:12,代码来源:BattleScene.cpp


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