You mean who Scenes now inherit from Ref?
Why Ref?
I love lambdas. They also give you the flexibility to change a callback at run-time and I think composing and delegating should always be preferred to inheriting. Developers are just overusing the OOP paradigms.
Back to C and Data Oriented Design ![]()
Youāre right about that, it does make a lot more sense to use delegating rather than coding to an interface all the time. I do tend to favour composition to inheritance in general, but you just have to know when to use what, but in order to know whats right, you gotta make a bunch of mistakes first. 
I just upgraded to 3.4, but still getting the same thing! Maybe I need a beer.
Not to forget about reading truckloads of books(the ābibles on the specific subjectā) and articles.
So it must be connected to your way of creating the scene/layer instance then.
If you could provide the basic compile ready source code, I could integrate in in my code and look into it.
I only can force my code to generate a black-screen by creating an infinite-loop.
So very very strange!
Changed my code to try to push a different scene: MainMenuScene, and Iām still getting the same result, even though MainMenuScene doesnāt implement onEnterTransitionDidFinish or anything like that and doesnāt try to push any other Scenes. What still baffles me is why when I add the DelayTime, this problem just goes away, even when pushing a GameScene, which you believe was causing an infinite loop.
@iQD @Array @slackmoehrle
Ok figured it out!!!
The two Scene classes involved are MainMenuScene and GameScene:
MainMenuScene pushes the GameScene via this code:
transition = TransitionFadeDown::create(0.0f, gameScene);
Director::getInstance()->pushScene(transition);
The GameScene pushes a tutorial flagged GameScene object Scene inside the onEnterTransitionDidFinish callback.
If I remove the transition from where MainMenuScene pushes the GameScene, the black screen problem goes away. Even if I set the Transition duration to 0, it still causes the black screen, so only removing the transition effect fixes this.
I believe this is a bug in cocos2d-x, unless there is something Iām not understanding.
Thanks for all your help!
Yeah, cause you forgot to mention your boolean guard
But at least this is already clarified.
Is it the case, that your game is still running fine? Game logic and stuff, but the only problem is, that nothing gets rendered onto the screen right?
Very mysterious. You must have something special in your GameScene, which breaks the transition somehow.
I tried all kinds of transitions with different duration and all work flawlessly. To match your ācodeā, I also implemented it the same way and no problems at all.
Is this happening on all platforms? Where are you trying your code? Windows I guess?
Iām running directly on an iOS device and a Simulator, Iāll try this on other platforms and report back. There really isnāt anything special, I know very well what my GameScene is doing, like I said, every other scene is doing the same thing.
So whatās missing is basically the rendered output? The scene runs as expected without the drawn content.