首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在SKTextureAtlas中找不到纹理图像

在SKTextureAtlas中找不到纹理图像
EN

Stack Overflow用户
提问于 2014-01-09 02:08:15
回答 1查看 268关注 0票数 0

我在Xcode5上使用spritekit。我创建了一个名为images的文件夹,扩展名为".atlas“。在模拟过程中,我创建了这些图像: bear1.png,bear2.png和bear3.png。这个图像是由”SKTextureAtlas atlasNamed:@“SKTextureAtlas”“创建的,但是当我尝试使用”ursoAtlas textureNamed:@“bear1”恢复一些图像时,它找不到图像。我打印了变量temp,它返回"MissingResource.png“,代码中的numImages为0。我预计numImages是3。

代码语言:javascript
复制
SKTextureAtlas *ursoAtlas = [SKTextureAtlas atlasNamed:@"images"];

SKTexture *temp = [ursoAtlas textureNamed:@"bear1"];

NSLog(@"%@", temp);
int numImages = ursoAtlas.textureNames.count;
NSLog(@"%d", numImages);
EN

回答 1

Stack Overflow用户

发布于 2014-01-09 21:01:47

一切看起来都很好。你把images.atlas拖到项目里了吗?或者,您可以尝试创建新的test_image.atlas并将其拖动到项目中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21003301

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档