How to Preload a .CSB file on Cocos2d-x?

  • finalpets
    Likes 0

    Problem Description

    Can I preload a .csb file? like i this example for TextureCache

    auto TexureCache = Director::getInstance()->getTextureCache();
        TexureCache->addImageAsync("MainMenuScreen/Background.png", CC_CALLBACK_1(GS_Loading::LoadingCallback, this));

    And this one for Music?

        auto audio = CocosDenshion::SimpleAudioEngine::getInstance();
        audio->preloadBackgroundMusic(AUDIO_STAGE_1);

    this is the normal way to load a .csb fle

    auto node = CSLoader::createNode("CS_MainMenu/MainScene.csb");
        addChild(node);

    Because a .csb file have multiple Scenes and Layer Button, and all the sprite on it etc.

  • Sonar Systems admin
    Likes 0

    Dont know if you can.

Login to reply