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

Device Simulator

Discussion in 'Package Manager' started by unayozan, Mar 11, 2021.

  1. unayozan

    unayozan

    Joined:
    May 11, 2018
    Posts:
    12
    Hi,

    I was in a spesific case of making the UI design and testing on the Device Simulator, which makes everything easier. The only thing I wanted to do that the simulator does not do right now is to fix the UI aspects in "safe zones". When I enable safe zones for my project;
    Android - Render Outside Safe Zone
    iOS - Status Bar Not Hidden

    I want my device simulator to fix its corners.
    upload_2021-3-11_13-47-3.png
    upload_2021-3-11_13-48-17.png

    Basicly, this is my current case;
    upload_2021-3-11_13-40-22.png
    I want that UI image to move inside the safe zone, which it will do correctly in a build.
     

    Attached Files:

  2. RomanBanana

    RomanBanana

    Unity Technologies

    Joined:
    Jun 23, 2015
    Posts:
    51
    Hello! Device Simulator does not currently support "Render Outside Safe Zone" and "Status Bar Not Hidden". We already have a bug report submitted for this issue. You can track the status of that bug here.

    However, these two options do not contain the UI inside the safe area. In case of Android the option will show black bars outside of safe area, which of course might be what you are looking for.

    But in case you want to keep rendering outside of the notch, but contain UI inside of the safe area, you should adjust the size of your UI container to fit inside the safe area. You can query the save area by reading Screen.safeArea.

    Unity does not have an automatic way to keep UI inside of the safe area. There are asset store packages that can do that, like this one https://assetstore.unity.com/packages/tools/gui/safe-area-helper-130488.
     
    UnityMaru likes this.