When I use replaceScene, How to apply fade in/out effect between those two scenes?
Can u anybody plz give me a simple example of it? Thx.
When I use replaceScene, How to apply fade in/out effect between those two scenes?
Can u anybody plz give me a simple example of it? Thx.
I think you should run TestCpp and checkout TransitionTest.
Ah! Okay. Thx for your advice, Minggo.
I have seen your great works here whenever I tried to find some information about cocos2d-x cuz I am a learner, and I used to guess you are a member of the developer of Cocos2d-x team including James Chen. Is it right?
Anyway, Thx a lot.
You can apply several Transitions using the CCTransition classes.
http://www.cocos2d-x.org/reference/native-cpp/d0/d7d/_c_c_transition_8h.html
For example, to create a Fading effect:
// cocos2d-x-2.0.4
// This will replace a scene with a fading transition effect.
// The fade effect has a duration of 0.2 seconds, opens HelloWorld::scene(), and tints the screen YELLOW instead of the default BLACK.
CCTransitionFade * trans = CCTransitionFade::create( 0.2f, HelloWorld::scene(), ccYELLOW );
CCDirector()::sharedDirector() -> replaceScene( trans );
Thx so much Lance Gray