帧动画runAction()报错:Run-Time Check Failure #0 - The value of ESP was not prope

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

源码:
Animation * animation = Animation::create();
SpriteFrame * spriteFrame = G_cache->getSpriteFrameByName(“fireType1_1.png”);
animation->addSpriteFrame(spriteFrame);
spriteFrame = G_cache->getSpriteFrameByName(“fireType1_2.png”);
animation->addSpriteFrame(spriteFrame);
animation->setDelayPerUnit(0.2f);
Animate *animate = Animate::create(animation);
Node *node = Node::create();
addChild(node,1000);
node->runAction(RepeatForever::create(animate));
node->setPosition(100,100);
中断点:

自己顶一个 :2::2::2::2::2::2::2::2::2::2:

谁能帮我看看么:6:

自己解决了。static_cast<Sprite *>(_taget)->setSpriteFrame(),taget的类型必须是Sprite,也就是说
Node node = Node::create();
addChild(node,1000);
node->runAction(RepeatForever::create(animate));
要改成
Sprite
node = Node::create();
addChild(node,1000);
node->runAction(RepeatForever::create(animate));

不要用Node去运行Animate,要用Sprite。

PS:你还是写错了。不要做这样的强转。

嗯嗯,我试过了,使用Sprite 就OK了