I have two scenes - MainScene and GameScene.
On both init method I create CCSpriteBatchNode and use it in the scene.
When switching from MainScene to GameScene using:
CCTransitionScene transition = CCTransitionFade::create);
I get some flickering, showing me the texture I’m using for the GameScene and then showing the GameScene properly.
When I create the GameScene in AppDelegate, like I did with MainScene, everything works well, I guess because it something to do with caching the textures. But this way I have to load all the textures for all the scenes in the beginning.
In the end of AppDelegate::applicationDidFinishLaunching I do:
CCScenepScene = StoryScene::scene();
In the beginning of MainScene::init I do:
m_pBatchNode = CCSpriteBatchNode::create(“main.pvr”);
In the beginning of GameScene::init I do:
m_pBatchNode = CCSpriteBatchNode::create(“game.pvr”);
And when I switch from MainScene to GameScene (by handling touch-up event):
CCTransitionScene *transition = CCTransitionFade::create(1.0f, GameScene::scene());
I want to be able to load the textures just when I need them per scene.