Spritekit - not loading @3x images from SKTextureAtlas

后端 未结 5 552
忘掉有多难
忘掉有多难 2020-11-30 07:51

Since my sample project was deleted (I thought this would be much easier to test), I will post some code and images to illustrate my point.

Here are sample images

5条回答
  •  我在风中等你
    2020-11-30 08:41

    It seems a bug when Xcode generates the compiled atlas. If you check inside the package of your compiled app, you will see that Xcode is not creating the correct atlas names for the @3x images.

    I've managed getting the @3x assets by creating atlases with the @3x name, and leaving the image without the suffix.

    And you can check for the UIScreen.mainscreen().scale to decide the atlas name to use. Check the atlas name in the attached image, and the code inside getTextureAtlas enter image description here

提交回复
热议问题