How to have text scale properly in Unity for all screen sizes?

11,779

Changing the game view in Unity is only useful for checking how the UI looks with different aspect ratios, not different resolutions.

You can control how the UI scales with the Canvas Scaler component (you will find it on the Canvas GameObject): http://docs.unity3d.com/Manual/script-CanvasScaler.html

You will likely want to use the "Scale With Screen Size" mode.

Share:
11,779

Related videos on Youtube

Anton nelson
Author by

Anton nelson

Updated on June 04, 2022

Comments

  • Anton nelson
    Anton nelson almost 2 years

    So I am making a scene in Unity where I have text, and I have created a canvas and text box and everything... but when I change the size of the game preview window, the size of the text changes too. This makes the text impossible to read on small screens as it is too small! How can I make the text the same size for all screen sizes?

    Also, when I change the size of the Game preview window in Unity, is it the same as changing the screen size? Or is it simply scaling everything?

    • Fattie
      Fattie over 7 years
    • Fattie
      Fattie over 7 years
      It is critical to select "scale with screen space". In Unity5, Unity accidentally set the WRONG default option on that menu. Until they fix the problem, it is essential to remember to select "scale with screen space". That's the only problem you're having.
  • Anton nelson
    Anton nelson over 8 years
    Thanks! That seems to have fixed my problem. Actually, there is a way to change the screen resolution the game window. Click on where it shows your aspect ratio then hit the +. Also, if I look at an app in 16:9 aspect ratio, that is landscape mode. So if I look at it with 9:16 aspect ratio, that is portrait mode. Is my thinking correct?
  • Jan Ivar Z. Carlsen
    Jan Ivar Z. Carlsen over 8 years
    Yes you can enter specific screen resolutions for the game view, but I believe this will still only really affect the aspect ratio. You are indeed correct that 16:9 is landscape and 9:16 is portrait. Any resolution where the width is larger than the height is a landscape resolution, and then of course a resolution where the height is larger than the width is a portrait resolution.
  • Fattie
    Fattie almost 6 years
    for 2018, it is completely explained here: stackoverflow.com/a/36268018/294884