Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

UI doesn't fit every screen

Hi everyone. I've always had problems with how Unity deals with rendering UI elements on different screens. I sent my game to one of my friends to test it out and I think they have a larger monitor than mine thus the game looked kinda smaller on his computer. How do I fix this issue so that the UI looks exactly the same on every monitor and resolution? Thanks

Answers

  • Titan_STitan_S Member
    edited September 2023

    There are a few things you can do to make sure that your UI looks the same on all monitors and resolutions in Unity:

    1. Use the Canvas Scaler component. The Canvas Scaler component can be used to scale your UI canvas to fit any screen size and resolution. To use the Canvas Scaler component, simply add it to the root GameObject of your UI canvas. Then, set the Canvas Scaler's UI Scale Mode to Scale With Screen Size
    2. Use anchors. Anchors can be used to position UI elements relative to the edges of the screen or other UI elements. This means that your UI elements will always be positioned in the same place on the screen, regardless of the screen size or resolution. To use anchors, simply click on the anchor icon in the Inspector window for the UI element you want to anchor. Then, drag the anchor lines to the edges of the screen or other UI elements.
    3. Use font size multipliers. Font size multipliers can be used to scale the size of your UI fonts based on the screen size and resolution. To use font size multipliers, simply open the Font Settings window (Edit > Project Settings > Graphics) and set the Font Size Multiplier for each font size.


Sign In or Register to comment.