CC_CALLBACK_*

Cocos2dx 3.x std::bind CC_CALLBACK_* 回调函数

断了今生、忘了曾经 提交于 2019-12-07 01:11:34
boy = Sprite::create("boy.png")//创建boy boy->setPosition(Point(visibleSize.width/2, visibleSize.height/2)); this->addChild(boy,1); girl_1 = Sprite::create("girl1.png");//创建girl_1 girl_1->setPosition(Point(visibleSize.width/3,visibleSize.height/2)); girl_1->setTag(10); this->addChild(girl_1,1); gitl_2 = Sprite::create("girl2.png")//创建girl_2 gitl_2->setPosition(Point(2*visibleSize.width/3,visibleSize.height/2)); girl_2->setTag(20); this->addChild(girl_2,1); //让boy运动,通过Callfunc回调到callback1 boy->runAction(CCSequence::create(MoveBy::create(1.0f,Poin(0,100)), CallFunc::create(CC_CALLBACK_0(HelloWorld