Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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?