Cocos2dx PopScene with Transition
template<typename T> | |
void CCDirector::popSceneWithTransition(float t) { | |
CCAssert(m_pRunningScene != NULL, "running scene should not null"); | |
m_pobScenesStack->removeLastObject(); | |
unsigned int c = m_pobScenesStack->count(); | |
if (c == 0) { | |
end(); | |
} | |
else { | |
m_bSendCleanupToScene = true; | |
m_pNextScene = m_pobScenesStack->getObjectAtIndex(c - 1); | |
CCScene* trans = T::transitionWithDuration(t, m_pNextScene); | |
m_pobScenesStack->replaceObjectAtIndex(c-1, trans); | |
m_pNextScene = trans; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
update code for cocos2d-x 3.0+