What is the difference between CCCallFunc and CCCAllFuncN

Yes, I'm not sure I understand the difference. Since you can also specify the target using CCCallFunc.

+6
cocos2d-iphone
source share
1 answer

CCCallFuncN passes the CCNode to which you called the action. For example, if you need to run an action that removes a node from its parent, you can use CCCallFuncN, and then the specified method will look like this:

-(void)theCalledMethod:(CCNode *)thePassedNode { [thePassedNode.parent removeChild:thePassedNode]; } 

If you used CCCallFunc, you would need to save the link to the specified node in order to be able to get it later and delete it in the called method.

+10
source share

All Articles