Reputation: 125
I'm making a game in SpriteKit, and positioning cards with code. The size of the card texture needs to be different based on screensize or the layout is screwed. Same with background images of course, or ANY other layout. How does the iphone6 share the same @2x assets with the lower-res screens? It makes no sense. I've heard to design for the 6, and let the older phones down scale. but this doesnt seem to be what is happening. Everything is just cut off when checking on 5s. My assets for 6+ are fine, but of course it uses its own set of 3x images.
Upvotes: 4
Views: 622
Reputation: 126137
Display scale factor doesn't tell you everything you might want for choosing assets and laying out your screen — e.g. if all you have are @2x
assets, they're used on both iPhone (4 and newer) and iPad (3 and newer) even though the iPad and iPhone have very different screen sizes.
SpriteKit's image loading falls back to UIKit's, which automatically picks the right scale factor for your device but not the right dimensions. So, much like how you have to do your own heavy lifting to choose different images for iPhone 4/4s vs iPhone 5/5s, you'll also need to look at the screen size yourself to pick images and/or do layout calculations on 3.5", 4", and 4.7" displays.
(Actually, you can get UIKit to automatically pick iPhone 3.5" vs iPhone 4" images if you use Xcode asset catalogs, but it doesn't look like those cover the 4" vs 4.7" issue. That's probably worth filing a bug about.)
Upvotes: 1