Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Designing UI for Mobile in 2023

Discussion in 'UGUI & TextMesh Pro' started by BeardlyDan, Aug 3, 2023.

  1. BeardlyDan

    BeardlyDan

    Joined:
    Oct 18, 2013
    Posts:
    28
    Hello Everyone,

    Many existing tutorials, e-books, and forum discussions often recommend using a reference resolution of 1920x1080 for designing & implementing mobile games in Unity. However, given the advancement in smartphone technology, today's devices boast higher resolutions and offer wider aspect ratios.

    I'm curious - are you continuing to design your art and user interfaces based on the traditional 1920x1080 (16:9) resolution, or have you adapted to the changing landscape of mobile screen sizes and resolutions?

    I appreciate your insights!
     
  2. karderos

    karderos

    Joined:
    Mar 28, 2023
    Posts:
    376
    should always assume that its gonna be wider than 16:9, but not by a lot

    make it work dynamically so that it looks good even in odd aspects
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,015
    I always engineer to the default CanvasScaler of 800 x 600, set to match height. See below.

    This approach lets all my projects have compatible parts. Any other custom resolution approach is not helpful unless somehow you have hard-coded numbers, and nobody that I know designs UI that way. And even if they did, a little math and you can scale it to 800 x 600... so why not stick with that to start?

    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
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,580
    The 2D team do not develop the UI systems in Unity so please ask about UI in one of the UI forums.

    I'll move your post to the UGUI forum but there's also the UIToolkit forum.

    Thanks