Search Unity

SetResolution Screen.width not same

Discussion in 'Scripting' started by Diversity276, Mar 4, 2015.

  1. Diversity276

    Diversity276

    Joined:
    Mar 22, 2014
    Posts:
    51
    Hey guys,

    short question.
    Yesterday i found out then i can resize my android-app-game by execute following command:
    Screen.SetResolution(720, 1200);

    The problem is: if i ask Unity for Screen.Height it does not return the value of 1200 for me its return 800 which is my original resolution (480x800 Samsung Galaxy S3 Mini).


    Hope some of you can help me :)

    Best regards

    Kevin
     
  2. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    http://docs.unity3d.com/ScriptReference/Screen.SetResolution.html
    2 points:
    If no matching resolution is supported, the closest one will be used.
    (can your device handle the new res)
    and
    A resolution switch does not happen immediately; it will actually happen when the current frame is finished
    (dont check screen.height until after you have switched)
     
  3. Diversity276

    Diversity276

    Joined:
    Mar 22, 2014
    Posts:
    51
    Ok thats helps me a lot thanks.


    May anyone have a second idea how to work on android for any resolution?

    Best regards.