How to pop scene with transition?

How to pop scene with transition?


I can push a scene with transition like this:

cc.director.pushScene(new cc.TransitionFade(1.0, new PausedLayer()));

However when I pop the scene, no transition is applied:


How can I pop a scene with transition in JavaScript?


That’s currently not possible, but some people implemented it by themselves. Tip) implement popScene with Transition


Personally I wrote my own scene subclass that has a layercolor that fades in and out as the scenes transitions. All my scenes derive from that class. I us the onEnter function to trigger the fade in and I wrote my own replace scene function inside my scene class that handles the fade out. The layercolor also catches any touches so you can’t break things as the scene fades out.