1
votes

I'm working for a game scene with SpriteKit in swift. I using Universal images.xcassets for background image. My image dimensions is 2208x1536(px) put on iPhone 3x asset.

It's look good on iPhone But on the iPad my background not fit to screen.

Look good on the iPhone. http://i.stack.imgur.com/RJzNu.jpg

But on iPad the background not fit to screen ? i.stack.imgur.com/bbvSx.png (please add http://)

This is my current image asset. i.stack.imgur.com/6CXUU.png (please add http://)

Then, I trying to use Device Specific images.xcassets then put same image on iPad 2x i.stack.imgur.com/n3jXZ.png (please add http://)

Now, background already fit to screen on the iPad, But any node coordinations and font size are incorrect. i.stack.imgur.com/ylZ4V.jpg (please add http://)

Here some info of my project.

// scene size & scale mode
scene.size = skView.frame.size
scene.scaleMode = .AspectFill

// background color
self.backgroundColor = SKColor.brownColor()

// add background image
let bg = SKSpriteNode(imageNamed:"bg")
bg.position = CGPoint(x: CGRectGetMidX(self.frame), y: CGRectGetMidY(self.frame))
self.addChild(bg)

And my artwork resolution i.stack.imgur.com/j9AAz.jpg (please add http://)

How to resolve this problem ?


EDIT:

I'm trying to use pixel space on my project, Now this problem is solved.

It's look good and correct coordinations on any device. http://i.stack.imgur.com/L1KoI.jpg

Thank you.

1

1 Answers

1
votes

It seems more an issue with scaleMode of the scene than an asset problem.

Understanding SKScene scaleMode

Scene Scaling Modes

EDIT: try using universal assets @2x - @3x and using bounds instead of frame universal assets used this reference image reference image. This are the results in iphone 6+ iphone 6+ and ipad Air ipad Air