Including callback support for onEnterTransitionDidFinish and onExitTransitionDidStart

This commit is contained in:
Rohan Kuruvilla 2012-08-27 18:08:27 -07:00 committed by folecr
parent 6c8d2ea75b
commit c62462d997
2 changed files with 9 additions and 1 deletions

View File

@ -808,11 +808,17 @@ void CCNode::onEnter()
void CCNode::onEnterTransitionDidFinish() void CCNode::onEnterTransitionDidFinish()
{ {
arrayMakeObjectsPerformSelector(m_pChildren, onEnterTransitionDidFinish, CCNode*); arrayMakeObjectsPerformSelector(m_pChildren, onEnterTransitionDidFinish, CCNode*);
#ifdef COCOS2D_JAVASCRIPT
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeFunctionWithIntegerData(m_nScriptHandler, kCCNodeOnEnterTransitionDidFinish, this);
#endif
} }
void CCNode::onExitTransitionDidStart() void CCNode::onExitTransitionDidStart()
{ {
arrayMakeObjectsPerformSelector(m_pChildren, onExitTransitionDidStart, CCNode*); arrayMakeObjectsPerformSelector(m_pChildren, onExitTransitionDidStart, CCNode*);
#ifdef COCOS2D_JAVASCRIPT
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeFunctionWithIntegerData(m_nScriptHandler, kCCNodeOnExitTransitionDidStart, this);
#endif
} }
void CCNode::onExit() void CCNode::onExit()

View File

@ -61,7 +61,9 @@ enum {
enum { enum {
kCCNodeOnEnter, kCCNodeOnEnter,
kCCNodeOnExit, kCCNodeOnExit,
kCCMenuItemActivated kCCMenuItemActivated,
kCCNodeOnEnterTransitionDidFinish,
kCCNodeOnExitTransitionDidStart
}; };
/** @brief CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode. /** @brief CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode.