Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity UI How does Unity determine the values of Screen.safeArea?

Discussion in 'UGUI & TextMesh Pro' started by Nananaaa, Apr 8, 2019.

  1. Nananaaa

    Nananaaa

    Joined:
    Jul 24, 2016
    Posts:
    31
    If you have access to Unity's source code, can you please comment how the values of Screen.safeArea are determined?

    On a Moto G7 Play, the width/height of Screen.safeArea match the values of Screen.width/height, which doesn't look right. Now I wonder if this is caused by Unity or by the device.
    Your feedback is much appreciated,

    Thank you,
    Michael.
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,367
    https://docs.unity3d.com/ScriptReference/Screen-safeArea.html

    This is likely the default for all tablets and phones, unless there is a specific device flaw reported to Unity. Overscan loss was a big problem for NTSC game boxes, less of a problem for older HD TVs, and non-existent for most handheld devices.

    But I expect you're wondering about the "notch" devices like the Moto G7 Play. A cut-out for a speaker/camera/proximity/notification lamp seems like it could interfere with gameplay and should be cut from the "safeArea".
     
    Nananaaa likes this.
  3. Nananaaa

    Nananaaa

    Joined:
    Jul 24, 2016
    Posts:
    31
    Exactly, hence the question. Sorry for not mentioning it.
    Thank you for commenting on it,
    Michael.