Sprite 帧动画 Cocos2d 3.0
问题描述
我一直在尝试制作动画精灵,它们有很多教程,但它们都是针对 Cocos2d 2.x 的.我的精灵表被命名为 fappbird.png 和 .plist 被命名为 fappbird.plist
I've been trying to make an animated sprite, they're are a lot of tutorials but they're all for Cocos2d 2.x. My sprite sheet is named flappbird.png and the .plist is named flappbird.plist
我有这段代码,但每次我启动场景时它都会崩溃,这是在我的 init 方法中
I have this code but every time i start the scene it just crashes, this is in my init method
推荐答案
Cocos2d 3.0 中使用 spritesheet 动画 sprite
Animate sprite with spritesheet in Cocos2d 3.0
确保在代码开头添加 #import "CCAnimation.h"
在 self.userInteractionEnabled = YES 之后添加精灵表;在初始化中
Also add the sprite sheet after the self.userInteractionEnabled = YES; in the init
不要在精灵所在的地方添加所有这些
No add all this where the sprite will be
希望这对某人有所帮助:D 干杯
Hope this helps somebody :D Cheers
这篇关于Sprite 帧动画 Cocos2d 3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!