标签:style blog color os io div new size
找到CCDirector.h,找到void popScene();
在下面加上一段类模板
template <class T> void popSceneWithTransition(float t) { CCASSERT(_runningScene != nullptr, "running scene should not null"); _scenesStack.popBack(); ssize_t c = _scenesStack.size(); if (c == 0) { end(); } else { _sendCleanupToScene = true; Scene* scene = T::create(t, _scenesStack.at(c - 1)); _scenesStack.replace(c - 1, scene); _nextScene = scene; } }
在需要调用的地方,一句话
Director::getInstance()->popSceneWithTransition<TransitionFade>(1.0);
常用的Transition应该都可以用
cocos2d-x的popScene的动画效果,布布扣,bubuko.com
标签:style blog color os io div new size
原文地址:http://www.cnblogs.com/ziyouchutuwenwu/p/3883532.html