Cocos2d - animationwithframes:延迟:已弃用

wil*_*ilM 8 iphone deprecated cocos2d-iphone ios

我想知道我应该用什么代替

animationWithFrames:delay:
Run Code Online (Sandbox Code Playgroud)

actionWithAnimation:restoreOriginalFrame:
Run Code Online (Sandbox Code Playgroud)

因为他们发出警告说他们已经被弃用了.

Ben*_*ove 12

Cocos2d 2.0使用

CCAnimation

+(id) animationWithSpriteFrames:(NSArray*)frames delay:(float)delay
Run Code Online (Sandbox Code Playgroud)

CCAnimate

+(id) actionWithAnimation: (CCAnimation*)anim
Run Code Online (Sandbox Code Playgroud)

文档:

http://www.cocos2d-iphone.org/api-ref/2.0.0/interface_c_c_animation.html

http://www.cocos2d-iphone.org/api-ref/2.0.0/interface_c_c_animate.html


Jul*_*ñoz 11

您需要做的唯一更改是使用新属性:restoreOriginalFrame.

从构造函数中删除restoreOriginalFrame,然后在新行中设置属性:

animation.restoreOriginalFrame = NO;
Run Code Online (Sandbox Code Playgroud)

而已!