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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Why doesn't my UI Builder represent the actual UI (sizes)?

Discussion in 'UI Toolkit' started by Shuchrid, Jul 27, 2022.

  1. Shuchrid

    Shuchrid

    Joined:
    Aug 15, 2021
    Posts:
    2
    I am not sure why this is happening...
    There's a difference between what I see on UI Builder, to what is actually displayed on the Device Simulator.

    This is how it looks -
    UI Builder:
    upload_2022-7-27_16-50-48.png
    (as you can see, the buttons and labels are tiny!)

    The actual Simulator:
    upload_2022-7-27_16-53-26.png
    (buttons and labels changed size???)

    It's a real struggle to make UI, when the UI Builder doesn't represent the actual UI....
    Is this a 'settings' issue?
    Anyone encountered this problem?

    Thanks in advance! :)

    *edit: more syntax.
     
  2. FlaSh-G

    FlaSh-G

    Joined:
    Apr 21, 2010
    Posts:
    212
    At the top right of the UI builder, switch "Active Editor Theme" to "Unity Default Runtime Theme".
     
  3. Shuchrid

    Shuchrid

    Joined:
    Aug 15, 2021
    Posts:
    2
    Thanks for the reply.
    I switched to "Unity Default Runtime Theme", and it made the buttons and labels a fraction bigger...
    I've played with the canvas size of UI Builder, and it seems like Unity simulator's resolution is shrunk by 4 times (1080x2340 -> 270x585):

    upload_2022-7-28_2-12-24.png


    Why does it do that....???
     
  4. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,064
    well your Device Simulator window is on 26%.
    If you set the Canvas Size to Match Game View and then have both percentages of the viewport the same, it should be the same. (Except not for the actual physical size)
    You're working with several different scaling mechanics. Physical Size, Device Simulator Viewport Scale and UI Builder Viewport Scale.

    The UI Document uses Panel settings. If you scale the UI by Physical Size set the Google Pixel 5's DPI value as reference.
    It's a bit like uGUI, fiddle with settings until it is right.

    I've submitted a finer control over the UI Builder viewport scale to the Roadmap. Though it is always uncertain whether it has been looked at, under consideration or has been denied.
     
    Last edited: Jul 28, 2022