Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Problem resizing images with spriteKit and swift

Im making a game with swift and spriteKit with xcode 6.1.

My problem is that, when I run the game on the iPhone 6 or iPhone 6+ the scene/images dont resize properly

I have this on my GameViewController

// Configure the view.
let skView = view as SKView
skView.multipleTouchEnabled = false

// Create and configure the scene.
scene = GameScene(size: skView.bounds.size)
scene.scaleMode = .AspectFill

// Present the scene.
skView.presentScene(scene)

And this on my GameScene

override init(size: CGSize) {
 super.init(size: size)

 anchorPoint = CGPoint(x: 0.5, y: 0.5)

 let background = SKSpriteNode(imageNamed: "Background")
 addChild(background)
}

I have tried all the scale modes but they dont seem to work. I hope someone can tell me what is going on