Guys, I’m not very familiar with C ++ yet.
Follow the below error
reference to type ‘const Vector<cocos2d::SpriteFrame *>’ could not bind to an lvalue of type ‘CCArray *’ (aka ‘cocos2d::__Array *’)
can someone help?
Guys, I’m not very familiar with C ++ yet.
Follow the below error
reference to type ‘const Vector<cocos2d::SpriteFrame *>’ could not bind to an lvalue of type ‘CCArray *’ (aka ‘cocos2d::__Array *’)
can someone help?
Are you using cocos2d-x v3.x? If so, there are a couple of things you need to change.
Something like this:
Vector<SpriteFrame *> ar;
ar.pushBack(sfc->spriteFrameByName("m1.png");
ar.pushBack(sfc->spriteFrameByName("m2.png");
ar.pushBack(sfc->spriteFrameByName("m3.png");
ar.pushBack(sfc->spriteFrameByName("m4.png");
ar.pushBack(sfc->spriteFrameByName("m5.png");
ar.pushBack(sfc->spriteFrameByName("m6.png");
sprite->runAction(
RepeatForever::create(
Animate::create(
Animation::createWithSpriteFrames(ar, 0.15f))));
addChild(sprite);
Worked! Thanks!
Good to know