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

Question Cross-device UI is Unclear.

Discussion in 'Editor & General Support' started by Simplisticated_Development, Sep 14, 2023.

  1. Simplisticated_Development

    Simplisticated_Development

    Joined:
    Jun 26, 2023
    Posts:
    61
    Hello everyone-

    I am pretty new to unity. I have a question about UI.

    So in a scene I made, there are a few images in buttons. I designed them through testing in build mode repeatedly. For build mode, I used the default settings for windowed view. When I change these settings/do fullscreen mode, my UI gets completely messed up. It will sometimes shift positions or be too small. I think this has to do with constraints, but I am failing to understand about how to use them.

    I tried to look this issue up online, but I might be using the wrong keywords because I cannot find a clear answer.

    Thanks to anyone who replies!

    Edit: I am mainly looking for how you make ui have the same scale size in different screen sizes.
     
    Last edited: Sep 14, 2023
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    This is the magic sauce:

    Here are some notes on UI Anchoring, Scaling, CanvasScaler, etc:

    https://forum.unity.com/threads/inc...size-between-two-people.1130146/#post-7261747

    https://forum.unity.com/threads/game-ui-button-size-problem.1142650/#post-7337383

    Usually you need to choose a suitable ScaleMode and MatchMode in the Canvas Scaler and stick with it 100%. Generally if you change those settings you will often need to redo your UI entirely.

    I also use this
    CanvasScalerOrientationDriver
    utility to make sharing UI for Landscape / Portrait easier. Read what it does carefully.

    https://gist.github.com/kurtdekker/8802b1b6c708637398f8c9167641efd3