on执行完毕的回调

on执行完毕的回调

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;

....

}

05-11 00:59