Search Unity

Bug Screen.GetDisplayLayout() do not take the display orientation into account

Discussion in 'Editor & General Support' started by Gladyon, Dec 10, 2021.

  1. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    Screen.GetDisplayLayout() provides a list of displays without taking the orientation into account.
    Display.displays provides a list of displays which do take the orientation into account.

    On a 2 displays configuration, set one display in portrait orientation in Windows (90 degrees rotation from the standard), and execute 'GetDisplayLayout()'.

    If the display in portrait mode has a resolution of 1920x1080, it has become 1080x1920 in Windows.
    'GetDisplayLayout()' will wrongly indicate 1920 for the width and 1080 for the height.
    Display.displays will provide the accurate information, 1080 for the width, and 1920 for the height.