Custom callbacks in a Sequence of Actions; Things I didn’t know about Cocos2d-x, but I probably could have read in the docs somewhere #5

CallFunc is an Action that lets you do callbacks after your action. Something like

auto seq = Sequence::create(MoveTo(1.0f, Vec(200, 350)), CallFunc::create(func));
my_node->runAction(seq);

That’ll move the node my_node, and then call func right after.

Leave a Reply

Your email address will not be published.