Saturday, September 8, 2012

cocos2d replaceScene

I had a scene where I was loading things on another thread and then when it finished I would use the CCDirector replaceScene to go to the next scene.  The problem was that the next scene would flash for a split second and then just show the loading scene.

It turns out that I was doing everything in the init method and I guess that's not good since the scene is initializing and then your telling it to be replaced before it returns.  I ended up placing the loading and replaceScene method into onEnterTransitionDidFinish, not onEnter.  onEnter still did not work for me.

keywords: cocos2d replaceScene thread

No comments:

Post a Comment