创建动画时出现问题

发布于 2024-11-13 05:31:57 字数 363 浏览 10 评论 0原文

我正在使用 cocos2d 0.99.5。我需要创建动画。我的资源和项目中有 01.png 。没关系。我不明白为什么我无法创建框架。我收到错误 SIGABRT。

CCSprite *frame = [CCSprite spriteWithSpriteFrameName:@"01.png"];

我尝试使用这个

CCSpriteFrame *frame = [[CCSpriteFrameCache sharedSpriteFrameCache]
                        spriteFrameByName:@"01.png"];

但我遇到了同样的错误。

I'm working with cocos2d 0.99.5. I need to create animations. I have 01.png in my resources and in my project. It's ok. I don't understand why I can't create a frame. I've got error SIGABRT.

CCSprite *frame = [CCSprite spriteWithSpriteFrameName:@"01.png"];

I've tried to use this

CCSpriteFrame *frame = [[CCSpriteFrameCache sharedSpriteFrameCache]
                        spriteFrameByName:@"01.png"];

But I've got the same error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反差帅 2024-11-20 05:31:57

那是因为你的精灵必须在 spriteSheet 中。以下是有关创建动画的教程: http://www.cocos2d-iphone .org/wiki/doku.php/prog_guide:动画

That's because you must have your sprite in the spriteSheet. Here is the tutorial about creating animations: http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:animation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文