Cocos2d iphone cocos2d,我们可以调用“中的函数吗?”;顺序;喝雪碧?
首先我把精灵从a移到b。当它达到b时,我需要调用一个函数来处理精灵,即淡入淡出、更改图像等。我目前正在使用“序列”进行操作 但它给了我这个错误-Cocos2d iphone cocos2d,我们可以调用“中的函数吗?”;顺序;喝雪碧?,cocos2d-iphone,cocos2d-x,cocos2d-x-3.0,cocos2d-js,Cocos2d Iphone,Cocos2d X,Cocos2d X 3.0,Cocos2d Js,首先我把精灵从a移到b。当它达到b时,我需要调用一个函数来处理精灵,即淡入淡出、更改图像等。我目前正在使用“序列”进行操作 但它给了我这个错误- CCActionInterval.js:507 Uncaught TypeError: Cannot read property '_timesForRepeat' of undefined at Function.cc.sequence [as create] (CCActionInterval.js:507) at Class.sp
CCActionInterval.js:507 Uncaught TypeError: Cannot read property '_timesForRepeat' of undefined
at Function.cc.sequence [as create] (CCActionInterval.js:507)
at Class.sprite_create (app.js:110)
at Class.trigger (CCScheduler.js:261)
at Class.update (CCScheduler.js:167)
at Class.update (CCScheduler.js:480)
at Class.drawScene (CCDirector.js:226)
at Class.mainLoop (CCDirector.js:884)
at callback (CCBoot.js:2160)
按顺序,不能直接调用函数。添加callFunc或callBlock
这里是C++版本的例子:
auto scale = EaseElasticOut::create(ScaleTo::create(3.0f, 1.0f));
auto calb = CallFunc::create( [this] () {
this->check_basket_under( );
});
auto seq = Sequence::create(scale, calb, NULL);
GameOverLabel->runAction(seq);
有关google CallFunc的更多信息,请按顺序查看CallFunc的用法
auto scale = EaseElasticOut::create(ScaleTo::create(3.0f, 1.0f));
auto calb = CallFunc::create( [this] () {
this->check_basket_under( );
});
auto seq = Sequence::create(scale, calb, NULL);
GameOverLabel->runAction(seq);