2

When using the simulator for the iphone6 plus, the images that loads from an atlas, load at @2x~iphone, instead of the @3x~iphone. When I load an image (not using the atlas) the @3x~iphone works.

I'm using one atlas, which contains both @2x~iphone and @3x~iphone images (only loads @2x~iphone images). I read online to change the atlas folder name to @2x.atlas and @3x.atlas, but then an error comes up saying it cannot find the folder. I also changed the file name to @2x~iphone.atlas and @3x~iphone.atlas, but got the same error.

This is what I use to load the images to an array.

func build_ArrayTextureSegment() {

    for var i = 0; i <= 12; i++ {
        let texture:SKTexture = SKTextureAtlas(named: "Segments").textureNamed("\(i)")
        arrayTextureSegments.append(texture)
    }

}

my image names are "imagename"@2x~iphone.png and "image name"@3x~iphone.png. And the folder name is Segments.atlas.

Can anybody tell me why the @3x~iphone images are not loading?

JohnL
  • 570
  • 1
  • 5
  • 10
Jarron
  • 1,049
  • 2
  • 13
  • 29
  • That is a known bug with atlases. http://stackoverflow.com/q/28146685/3402095 There are some things I've tried by myself to make it work , but no luck : http://stackoverflow.com/q/29241752/3402095 @Jarron What iOS & Xcode do you use ? – Whirlwind Sep 11 '15 at 11:29
  • I'll read the links you provided shortly. Xcode is 6.4 and simulator is 8.4. I don't have an iphone6 plus to test the app on. – Jarron Sep 11 '15 at 11:36
  • You will see in the comments (first link) that same thing happens even if you use an actual device. – Whirlwind Sep 11 '15 at 11:40
  • From what I got from the links, is that you should setup code to read the device size and then use @2x images for the iphone6 plus. – Jarron Sep 11 '15 at 11:40
  • Not sure if you will know, but if the app gets published, will the @3x image work then? – Jarron Sep 11 '15 at 11:42
  • 1
    @Jaron You mean if it will work after this bug is fixed ? Theoretically yes, but who knows ... I would go only with 2x images (if atlas usage is necessary) because that is what you can test and know it will work for sure. When fix comes, then you can add 3x images support, test everything, update a game etc. But this is just me. – Whirlwind Sep 11 '15 at 11:51
  • 1
    Thanks Whirlwind for your input, I'll work with the 2x images until I hear that the 3x is working correctly. One of the links you provided goes back to January. It's surprising that apple hasn't fixed this problem yet. – Jarron Sep 11 '15 at 12:02
  • It seems to be working now, but only on iOS >= 9. Check out my answer here: http://stackoverflow.com/a/35410364/3402095 – Whirlwind Mar 27 '16 at 13:52

0 Answers0