A场景切换到B场景
1.不带过渡效果的场景切换 ,如下
cc.Director:getInstance():replaceScene(TestSceneB.new())
print("TestSceneA:onEnter()")
print("TestSceneA:onExit()")
print("TestSceneB:onEnter()")
2.带过渡效果的场景切换 ,如下
cc.Director:getInstance():replaceScene(cc.TransitionSlideInT:create(0.1,TestSceneB.new()))
print("TestSceneA:onEnter()")
print("TestSceneB:onEnter()")
print("TestSceneA:onExit()")
注:即使过渡动画的执行时间是0秒,也是如此. 原文链接:https://www.f2er.com/cocos2dx/339091.html