0

After pushing another scene on the stack then popping it off, the original scene does not get update calls, if I used a transition when pushing the other scene on.

Basically this

- (void)update:(CCTime)delta

does not get called for the scene, or any children, if I previously pushed with transition to a different scene before popping it off.

With this code (with no transition) everything works just fine:

CCScene *moreMovesScene = [CCBReader loadAsScene:@"GetMoreMoves"];
[[CCDirector sharedDirector] pushScene:moreMovesScene];

But this code does not work:

CCTransition *transition = [CCTransition transitionPushWithDirection:CCTransitionDirectionDown duration:0.3f];
CCScene *moreMovesScene = [CCBReader loadAsScene:@"GetMoreMoves"];
[[CCDirector sharedDirector] pushScene:moreMovesScene withTransition:transition];

Note that I can pop with transition just fine, it is just pushing another scene with any transition that causes a problem.

David John
  • 496
  • 1
  • 5
  • 17
  • 1
    Did you override (implement) onEnter/onExit or variants of these methods in the scene class you are loading? If so, you must call the super implementation. That might explain it. – CodeSmile Apr 07 '14 at 19:18
  • I did not implement any of those at first. But I did try adding them with calls to super to see if that might fix it. It didn't. – David John Apr 07 '14 at 20:15
  • What version of cocos2dv3 are you using? I know I had some funky behaviour with the version that was bundled in SpriteBuilder before the last update. Make sure you are using version RC4. – Tibor Udvari Apr 08 '14 at 20:39
  • COCOS2D_VERSION 0x00030000. I'll try getting the latest now thanks. – David John Apr 09 '14 at 20:57
  • Hmm updating Cocos2d is a bit of a pain! As there is to be a new version of Spritebuilder soon that will automatically update the cocos2d version for your existing project I think I will wait for that as this issue is not blocking me. – David John Apr 11 '14 at 17:50
  • I went for the plunge and grabbed the latest Cocos2d which completely fixed the issue. I followed instructions here if anyone else is a git noob like me. http://forum.spritebuilder.com/t/how-to-update-cocos2d-v3-inside-my-spritebuilder-project/376/5 – David John Apr 15 '14 at 05:12

0 Answers0