mirror of https://github.com/axmolengine/axmol.git
fixed #1159: Updated "CallFuncND + auto remove" test demo.
This commit is contained in:
parent
f7a1807865
commit
47af0886d3
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue