Understanding image size for various resolution screens

I find it difficult to put all the image size information for @ 1x, @ 2x and @ 3x together. I used the scene editor in Xcode, the scene size of which is 1334x750 (iPhone 6 screen pixel sizes). So when I do the image size for the sprite in this scene, is this the size I should use for @ 2x?

From what I read in the documentation, CGSize uses dots, not pixels, so if I have a CGSize image (width: 50, height: 50), does it not depend on my scene size in the scene editor?

Question on the bottom line: how are CGSize dimensions translated as I export my images for @ 1x, @ 2x and @ 3x in pixels, and what should be the PPI when exporting?

+4
source share
4 answers

The concept is simple. The size in the Storyboard or Interface Builder must be the size of your asset in @ 1x format.

The retina screen (or the size of the iPhone 6+ @ 3x) does not mean that you have a lot of space than before, it means that you can draw 2 (or 3) pixels, where you draw 1 earlier.

So, for a 50x50 px Image View, ku must have 3 assets: - Image@1x.png (50x50 px) - Image@2x.png (100x100 px) - Image@3x.png (150x150 px)

+1
source

Xcode , @2X @3X, PDF, . Sketches - PDF, @1X PDF, Xcode, Assets.xcassets, Scales Single Scale. Xcode @2X @3X PDF .

+3

, , , @1x.png 50x50 pixels, @2x.png 100x100 pixels @3x.png size 150x150 pixels.

, ( @1x.png), , iPhone6 ​​ iphone7, iPad ( @1x.png, @2x.png @3x.png)

, Auto layout Apple .

part1

part2

+1

@1x @2x , iPhone 4.

iPhone 3GS 320x480, iPhone 4 640x960. , , ppi , @2x. iPhone 5, , , , ppi , .

6 6+. Apple , , ppi, iPhone, iphones . @2x

, , iPhone SE, ppi iPhone 5, @2x .

Basically, when you think about @ 2x graphics, think about the 1st iPhone resolution size.

Now you have a choice. You can give your applications a more / less useful area, you can use a black box in an additional useful area, or you can scale and get some kind of loss of quality due to the fact that the pixels of the game will not be more than 1: 1 with the pixels of the screen.

+1
source

Source: https://habr.com/ru/post/1660100/


All Articles