2

I'm creating a game with SpriteKit and I have created assets for both iPhone 6 & iPhone 6 Plus sizes, but the problem is when I test in the simulator the iPhone 6 picks up whatever is in the @2x slot in the xcassets folder. So now I'm not sure if iPhone 6+ really is @3x, and if not how can I differentiate so that each resolution gets the correct asset.

I also tried all scale modes but none of them seem to have any effect, the scene is not even scaling or something, for example my background does not fill the entire screen when running on 6+.

Edit: this question is not a duplicate of another question, because in my case the iPhone 6+ doesn't recognise @3x assets, nothing does.

Edit: Sample Project: Dropbox

Abdou023
  • 1,654
  • 2
  • 24
  • 45

1 Answers1

2

In the sample project, nothing goes wrong except that the @3x image has the wrong size. To achieve what you want, you need to provide a image sized 1242x2208 for the reason being explained later. And that's also the size of launch screen for iPhone 6p retina screen.

In fact, the display resolution of iPhone 6p is lower than the natural @3x resolution, so the @3x will be automatically resized to approximately 87% (downsampling) of the original size. Learn more about the process here.

The result:

enter image description here

WangYudong
  • 4,335
  • 4
  • 32
  • 54
  • Have you noticed that 6+ also recognised the 2x ball, and not the 3x one ? – Abdou023 Sep 29 '15 at 16:08
  • @Abdou023 The size you print in console is 180/3=60, and 3x is truly loaded. To prove that, simply changed 3x image with any other different image, e.g, the night background and see what will display in your console. – WangYudong Sep 29 '15 at 16:13
  • I thought 60 is 120/2 Which the size of 2x, ok so now the right resolution for the ball for 3x should be 270 ? 270/3 = 90. and so on for all the 3x assets ? – Abdou023 Sep 29 '15 at 16:15
  • @Abdou023 60 for 1x, 120 for 2x and 180 for 3x. – WangYudong Sep 29 '15 at 16:17
  • You lost me again, because that's what they already are, 180/3 = 60, also 120 / 2 = 60, so the assets will have the same size on both 6 & 6+ which is the case right now, so why use 3x at all, if the size will reman the same ? – Abdou023 Sep 29 '15 at 16:22
  • @Abdou023 The reason for using 3x is to make sprite looks almost same on different device screens. Add a 120x120 blue ball to the 3x image to see the difference. – WangYudong Sep 29 '15 at 16:27
  • I see, thank you very much for your efforts. :) Bounty in 3 hours! – Abdou023 Sep 29 '15 at 16:29