
I apologize in advance for the huge post, but everyone who has ever tried to make some kind of universal application knows that this is quite problematic, so please be calm ...
goal
What I'm trying to achieve (shown in the image above) is to use @ 2x assets on iPhone 5 and 6 and maintain the same look and feel of the application. And, if possible, do all this without manually calculating the properties of the scale and the position of the nodes based on the detected device ... In short, how to get this application to automatically keep the proportions between the elements (and the scene)? I would also like to have the same kind of application on iPhone 6+ using @ 3x assets, but because of simplicity, I focused only on iPhone 5 and 6.
What I found on the Internet is that some people say that this (downsampling) is done automatically by iOS, for example, they offer this:
"Make the assets @ 2x the size of the iPhone 6, and then iOS will automatically scale for the iPhone 5."
But this is obviously not true when it comes to the Spritekit scene, or I'm missing something.
Problem
Despite the fact that the iPhone 6 and iPhone 5 have the same aspect ratio and the same PPI, using the same asset will not look compared to the size of the scene (see the sprite menu on the 1st and 2nd images compared with the size of the scene), since PPIs are related to the pixel density, and the iPhone 6 has more space (large diagonal, more inches), which means that it has more pixels than the iPhone 5. And here my problem arises, and I donβt know what would be an efficient way to handle it.
What have i done so far
The second image is not a problem for the graphical interface, but for the gameplay in my case it is because I want the same appearance on different devices. Just look at the first and third image.
Thanks to the Skyler Lauren proposal, I was able to get the same appearance of the application on all iPhone 5 devices, either on 7.1 or 8.1 systems, as well as on iPhone 6. So, now the problem is how to adapt this code to work with iPhone 6+ using textures @ 3x, as well as on the iPhone 4s. Here is the solution for iPhone 5 and 6:
View .m controller
GameScene *scene = [GameScene sceneWithSize:CGSizeMake(375,677)];
Thus, the scene always has a fixed size in the dimensions of the iPhone 6, and the size of the view varies depending on the device. I use the resource directory for startup images, not an xib file. Images have a recommended size of 640x960px for 4s, 640x1136px for 5, 750x1334px for 6, and 1242x2208 for 6+. Assets are sized for the iPhone 6, so there is no scaling for this model at all.
Regarding the 4s model, when I use this method described above, there are two black bars on each side ...
So far, I only tested this on the simulator and the iPhone 6 device (what I see is like the first image on the device or simulator).
Question
So far I have said that everything works on iPhone 4s (with two black bars due to different proportions), 5, 6 using 2x2 assets, but how to make everything work with iPhone 6+ using @ 3x assets? If I use the dimensions 375x667 for the scene, then everything is positioned correctly and has good proportions, but the quality suffers (due to 2x zooming)