Created
August 1, 2013 14:34
-
-
Save junaidk/6131963 to your computer and use it in GitHub Desktop.
Cocos2dx action sequence -- call a function after an action completion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int *value = new int(3); | |
CCLog("*value = %d", *value); //=> I get 3 here => ok | |
_coinsLabel->runAction((CCSequence*)CCSequence::actions( | |
CCDelayTime::actionWithDuration(.05f), | |
CCCallFuncND::actionWithTarget(this, callfuncND_selector(GameLayer::addCoins),(void*) value), | |
NULL)); | |
//function to called | |
void GameLayer::addCoins((CCNode* sender, void* data) | |
{ | |
int *value = (int*) data; | |
CCLog("*value = %d", *value); | |
// some code... | |
delete value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment