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
My atlas setup:
My launch image setup:
The code where I add these sprites to my scene
override func didMoveToView(view: SKView) {
let texture = SKTextureAtlas(named: "scenery")
let test = SKSpriteNode(texture: texture.textureNamed("test"))
test.position = CGPoint(x: self.size.width/2, y: self.size.height/2)
self.addChild(test)
}
These are my results:
iPhone 5 simulator:
iPhone 6 plus simulator:
I've tried changing the launch image to use the asset catalog. Then the iPhone 6 plus seems to upscale a 2x screen. It's still loading the 2x image, but scales it up.
I need it to load my 3x image and be to scale with my 2x image.
Gabuh's answer below pointed me in the right direction. Works on a new project. However, if I use his solution for my real SpriteKit project my 3x images don't get downscaled. They are 3x bigger than they should be.
Xcode 6.2 now loads @3x and @2x images out of one atlas. It loads a 1x size (and seems to resize the image on its own) if you do not put @2x/@3x at the end of the image name.
It seems to be working now if you are using a new way to create atlas. Important thing is that
Deployment target
should be >= 9.0 ...Select
Assets.xcassets
and click to + sign to create a new sprite atlas:Choose "New Sprite Atlas" option and add @2x and @3x assets :
Then in a code do this:
Hint:
If you are testing on Simulator, reset Simulator's content and settings to clear the cache before you try this.
Not sure why this was never done, but here is the start of a workaround that is actually correct, but is a little slower unfortunately. Maybe someone can see some things to make it process faster
This bug is still unsolved. By using just @2x images the visual of the app gets broken. Instead choose the right image by looking screen scale.
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 insidegetTextureAtlas