Search Unity

Setting screen ratio not work correctly

Discussion in 'Scripting' started by young-xyz, Jul 12, 2018.

  1. young-xyz

    young-xyz

    Joined:
    Feb 23, 2015
    Posts:
    51
    Hi.
    I want to fix screen aspect ratio 16:9 like this(yellow area is play area).
    smartphone2.png
    I used to Display.SetRenderingResolution in older version of Unity, but it is not work now(2017.4.6f1).
    It shows horizontally stretched screen in 2960 x 1440(galaxy s8).

    I tried Screen.SetResolution with fullscreen option true, but it was same as SetRenderingResolution. And it shows software keys with fullscreen false. And I tried androidmanifest android:windowSoftInputMode="stateHidden" option, it shows hidden in start, but it appears when setting screen resolution. What I want is 16:9 display with fixed aspect ratio, and the empty spaces are black without software keys.

    How can I do this?
     
    Last edited: Aug 16, 2018
  2. young-xyz

    young-xyz

    Joined:
    Feb 23, 2015
    Posts:
    51
    anyone?