fixed #1159: Updated "CallFuncND + auto remove" test demo.

This commit is contained in:
James Chen 2012-04-13 11:54:29 +08:00
parent f7a1807865
commit 47af0886d3
2 changed files with 8 additions and 1 deletions

View File

@ -850,7 +850,7 @@ void ActionCallFuncND::onEnter()
centerSprites(1); centerSprites(1);
CCFiniteTimeAction* action = CCSequence::actions(CCMoveBy::actionWithDuration(2.0f, ccp(200,0)), CCFiniteTimeAction* action = CCSequence::actions(CCMoveBy::actionWithDuration(2.0f, ccp(200,0)),
//CCCallFuncND::actionWithTarget(m_grossini, callfuncND_selector(ActionCallFuncND::removeFromParentAndCleanup), (void*)true), CCCallFuncND::actionWithTarget(this, callfuncND_selector(ActionCallFuncND::removeFromParentAndCleanup), (void*)true),
NULL); NULL);
m_grossini->runAction(action); m_grossini->runAction(action);
@ -866,6 +866,12 @@ std::string ActionCallFuncND::subtitle()
return "CallFuncND + removeFromParentAndCleanup. Grossini dissapears in 2s"; return "CallFuncND + removeFromParentAndCleanup. Grossini dissapears in 2s";
} }
void ActionCallFuncND::removeFromParentAndCleanup(CCNode* pSender, void* data)
{
bool bCleanUp = (bool)data;
m_grossini->removeFromParentAndCleanup(bCleanUp);
}
//------------------------------------------------------------------ //------------------------------------------------------------------
// //
// ActionSpawn // ActionSpawn

View File

@ -265,6 +265,7 @@ public:
virtual void onEnter(); virtual void onEnter();
virtual std::string title(); virtual std::string title();
virtual std::string subtitle(); virtual std::string subtitle();
void removeFromParentAndCleanup(CCNode* pSender, void* data);
}; };
class ActionFollow : public ActionsDemo class ActionFollow : public ActionsDemo