2

What I've noticed when running project on iPhone 6+ simulator is that simulator don't pick up right images. Instead of @3x, @2x images are used.

I tried reseting simulators content and settings, clean project and delete derived data from organizer and same thing still happens.

When I look for the myatlas.atlasc folder inside the myapp.app (show package contents) at the path:

/Users/username/Library/Developer/Xcode/DerivedData/appname-appspecificgeneratedstring/Build/Products/Debug-iphonesimulator/appname.app

I can see myatlas.atlasc (note that this is not myatlas.atlas) and inside there are two files instead of three. There is atlas.1.png and atlas.1@2x.png.

I suppose that there should be three files, one for the 1@x images, one for the @2x images and another one for @3x images.

The content of the first image (atlas.1.png) are all @1x images and @3x images. And the content of the atlas.1@2x.png are @2x images.

Next thing I've tried is to use Texturepacker which properly generate atlas for us. The files generated are atlasfilename.1.png, atlasfilename.1@2x.png and atlasfilename.1@3x.png. Also there is a properly generated .plist file. I added atlasc folder to my project and checked "Create folder references" instead "Create groups". But still simulator picks @2x images.

Then I tried to make my own atlases named HD_atlas.atlas and XHD_atlas.atlas and based on screen scale factor choose right atlas. In that case the proper atlas is chosen but I got MissingResource.png on the screen. If I name @3x images like image.png instead of image@3x.png and put them in XHD_atlas.atlas folder, then @3x image is loaded, but it's 3 times bigger. For now, until this is fixed, I ended up using @2x assets instead of @3x, because everything still looks pretty decent, even if it's upscaled.

I suppose this shouldn't be like this, and if anybody know how to make Spritekit to generate properly atlases or have some workaround in order to use @3x assets please feel free to post a suggestion.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Whirlwind
  • 14,286
  • 11
  • 68
  • 157
  • http://stackoverflow.com/questions/25781422/image-resolution-for-new-iphone-6-and-6-3x-support-added – sangony Mar 24 '15 at 20:15
  • @sangony so you are "saying" that this is a bug at the moment ? :( – Whirlwind Mar 24 '15 at 20:25
  • Are you running the latest iOS ? – sangony Mar 24 '15 at 20:26
  • I am testing on 8.1 on device...But mainly I am asking this because of simulator usage. – Whirlwind Mar 24 '15 at 20:28
  • I've seen a couple of posts complaining of the same issue. Maybe it is a bug in the way the atlases are created. If you keep running into a problem, your best bet is create your own atlases and use manual coding for the images used based on screen size. – sangony Mar 24 '15 at 20:32
  • Yeah, I get it...That's why I asked, because I wanted to avoid that. I remember earlier in Xcode 5, if I am not wrong, that there was a atlasname.1@3x.png image in atlasc folder. I will try to test this more. Thanks for help! – Whirlwind Mar 24 '15 at 20:34
  • Definitely is problem with Spritekit's generated files, because in atlasc there is no @3x atlas file. This is happening with Xcode 6.1.1 but there are post on SO which are saying that same happens with 6.2 Here is the link : http://stackoverflow.com/q/28146685/3402095 – Whirlwind Jun 11 '15 at 11:16
  • Anyone found a solution for this problem? – Philip Oct 09 '15 at 11:04
  • @Philip It seems to be working now, but only on iOS >= 9. Check this out : http://stackoverflow.com/a/35410364/3402095 – Whirlwind Mar 09 '16 at 02:55

0 Answers0