cocos2d-x action执行完毕的回调

前端之家收集整理的这篇文章主要介绍了cocos2d-x action执行完毕的回调前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

cocos2d-x action执行完毕的回调

MySprite::createOne()

{

....

// MUST add to sheet firstly
spriteSheet->addChild(sprite);

// create action
auto createAction = MoveTo::create(3.0f,Point(pos.x,pos.y));

auto sequence = Sequence::create(createAction,
CallFuncN::create(CC_CALLBACK_1(MySprite::onAfterCreateAction,sprite)),0);

sprite->runAction(sequence);

}


MySprite::onAfterCreateAction(Node * pSender)

{

MySprite * pThis = (MySprite *) pSender;

....

}

原文链接:https://www.f2er.com/cocos2dx/344548.html

猜你在找的Cocos2d-x相关文章