【发布时间】:2014-09-12 16:39:57
【问题描述】:
我有 NSLog 我的 textureAtlas,它加载了我所有的 @3x.PNG,但它通过调用 textureNamed 返回丢失的纹理:
#define TEXT_MAINMENU @"mainmenu"
SKTextureAtlas *textureAtlas = [SKTextureAtlas atlasNamed:@"414x736"];
NSLog(@"atlas: %@", textureAtlas);
SKTexture *_MAINMENU = [textureAtlas textureNamed:TEXT_MAINMENU];
NSLog(@"texture from skatlas: %@", _MAINMENU);
输出在这里:
图集:'414x736' 83 个纹理:( "'mainmenu@3x.png' (279 x 279)", "'winreplay@3x.png' (873 x 131)", "'bonus128@3x.png' (279 x 279)", "'maincake128@3x.png' (279 x 279)", "'bonus512@3x.png' (279 x 279)", ........
来自 skatlas 的纹理:'MissingResource.png' (128 x 128)
但是,我在哪里通过 textureWithImageNamed(而不是通过 SKTextureAtlas textureNamed)获取纹理,而它回退给我 @1x.PNG?
SKTexture *_MAINMENU2 = [SKTexture textureWithImageNamed:TEXT_MAINMENU];
NSLog(@"texture from sktexture: %@",_MAINMENU2);
输出在这里:
sktexture 中的纹理:'mainmenu' (90 x 90)
当然,对于运行良好的相同代码,我也有@1x @2x PNG,我想知道为什么我的textureAtlas/texture 不能自动找到我的@3x.PNG?我有什么问题吗?如何解决?
【问题讨论】:
-
在这种情况下什么是'textureAtlas'?第一行似乎遗漏了一些东西,有两个左括号但三个右括号。
-
@LearnCocos2D 感谢您的回复,请查看我的更新!
-
是的,对我来说似乎也不起作用 =/ 一些东西在最终版本中仍然很糟糕
标签: ios xcode sprite-kit iphone-6-plus