From c62462d99746456e11c69f66e9d46f778218ead2 Mon Sep 17 00:00:00 2001 From: Rohan Kuruvilla Date: Mon, 27 Aug 2012 18:08:27 -0700 Subject: [PATCH] Including callback support for onEnterTransitionDidFinish and onExitTransitionDidStart --- cocos2dx/base_nodes/CCNode.cpp | 6 ++++++ cocos2dx/base_nodes/CCNode.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 70585b455f..61541e7ed8 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -808,11 +808,17 @@ void CCNode::onEnter() void CCNode::onEnterTransitionDidFinish() { arrayMakeObjectsPerformSelector(m_pChildren, onEnterTransitionDidFinish, CCNode*); +#ifdef COCOS2D_JAVASCRIPT + CCScriptEngineManager::sharedManager()->getScriptEngine()->executeFunctionWithIntegerData(m_nScriptHandler, kCCNodeOnEnterTransitionDidFinish, this); +#endif } void CCNode::onExitTransitionDidStart() { arrayMakeObjectsPerformSelector(m_pChildren, onExitTransitionDidStart, CCNode*); +#ifdef COCOS2D_JAVASCRIPT + CCScriptEngineManager::sharedManager()->getScriptEngine()->executeFunctionWithIntegerData(m_nScriptHandler, kCCNodeOnExitTransitionDidStart, this); +#endif } void CCNode::onExit() diff --git a/cocos2dx/base_nodes/CCNode.h b/cocos2dx/base_nodes/CCNode.h index 758656a7ca..fbe75c196d 100644 --- a/cocos2dx/base_nodes/CCNode.h +++ b/cocos2dx/base_nodes/CCNode.h @@ -61,7 +61,9 @@ enum { enum { kCCNodeOnEnter, kCCNodeOnExit, - kCCMenuItemActivated + kCCMenuItemActivated, + kCCNodeOnEnterTransitionDidFinish, + kCCNodeOnExitTransitionDidStart }; /** @brief CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode.