Reputation: 716
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.
But on iPad the background not fit to screen ?
This is my current image asset.
Then, I trying to use Device Specific images.xcassets then put same image on iPad 2x
Now, background already fit to screen on the iPad, But any node coordinations and font size are incorrect.
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
How to resolve this problem?
Upvotes: 1
Views: 1835
Reputation: 119
It seems more an issue with scaleMode of the scene than an asset problem.
Understanding SKScene scaleMode
EDIT: try using universal assets @2x - @3x and using bounds instead of frame used this reference image . This are the results in iphone 6+ and ipad Air
Upvotes: 1