Home > Net >  Unity's Screen.width / Screen.height doesn't reflect my android device size
Unity's Screen.width / Screen.height doesn't reflect my android device size

Time:03-06

I'm using Galaxy22 Ultra so on unity,

Debug.Log(Screen.width "///????/" Screen.height);
Debug.Log(Screen.currentResolution);

both says width : 1080 height : 2316 which is not even reflect cellphone's ratio... if width is really 1080pixel then height should be maybe 3 or 4 times bigger. how can I get real pixel size of width and height

CodePudding user response:

seems likely Galaxy S22 Ultra native resolution is 3088 x 1440. But the OS maybe reduce it to standard resolution 1080 width, this would be 75% of original size.

Thus 3088 x 1440 (75%) will be 2316 x 1080 correctly.

Screen.width // this only return your rendering screen width

Usually, some mobile will optimised the performance by reducing rendering result from native resolution.

And surely your phone screen ratio won't be 3:1 or 4:1. Normally they are between 16:9(or 1.7:1) to 21:9(or 2.3:1).

  • Related