1

Has anyone been able to get the simulator in xcode 6 to use the 3x images inside of an atlas? Whenever I load them into SKTextureAtlas it will use the 2x image instead.

if i put test@2x.png, and test@3x.png inside of an atlas, my iphone 6 / plus simulator will always use the 2x image.

let texture = shipAtlas.textureNamed("ship")  // always uses 2x image
jww
  • 97,681
  • 90
  • 411
  • 885
hamobi
  • 7,940
  • 4
  • 35
  • 64

1 Answers1

0

apparently you need to have launch images set (in project settings) in order for xcode to recognize different screen sizes properly

hamobi
  • 7,940
  • 4
  • 35
  • 64
  • 1
    I have exactly the same problem and setting launch images doesn't solve it. Do you have any other suppositions how to load 3x instead of 2x? – alexburtnik Dec 08 '14 at 18:11
  • this is my way of loading images in spritekit. look at my answer http://stackoverflow.com/questions/27284856/spritekit-help-understanding-scaling/27364020#27364020 – hamobi Dec 08 '14 at 18:20
  • 1
    Yep, I store my images in a similar manner, but when it comes to texture atlas for iphone6+, 3x suffix is simply ignored: http://www.raywenderlich.com/forums/download/file.php?id=2156 – alexburtnik Dec 09 '14 at 07:26
  • This answer should be unchecked, it's not correct, at least it does not work for me. I have spaceship.png, spaceship@2x.png, spaceship@3x.png in graphics.atlas folder but for iPhone 6 Plus it always loads the 2x one. Having a LaunchScreen.xib, so the iPhone 6 Plus launches with screen size of 414x736 points. – Jonny Feb 25 '15 at 21:46
  • So did you get it to work some way? Or is it impossible to support 3x graphics using atlases? – Jonny Feb 25 '15 at 22:05
  • stackoverflow.com/questions/28146685/… i followed this.. but even then my game didnt look right to me. I just used ended up using all the 2x assets for the iphone 6 plus and let it scale it for the bigger screen – hamobi Feb 25 '15 at 22:07
  • 1
    Ok so this is a bug somewhere in SpriteKit/iOS... at least sounds like that. Maybe 3x can be loaded if we don't use atlases... but that would lose the atlas benefits. – Jonny Feb 25 '15 at 22:16
  • 1
    Yes it's a bug in sprite kit – hamobi Feb 25 '15 at 22:17
  • Just confirmed that using image asset catalogue, it does work (3x graphics are loaded correctly), but then we lose the benefits of atlases I guess. Sigh. – Jonny Feb 25 '15 at 22:30
  • You mean xcassets vs texture assets? – hamobi Feb 25 '15 at 22:31
  • Same thing here, iPhone 6+ simulator uses @2x images. I am using Xcode 6.1 – Whirlwind Mar 25 '15 at 16:17