我有 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?我有什么问题吗?如何解决?