4

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?

Anton nelson
  • 333
  • 3
  • 8
  • 18
  • Possible duplicate of [Scaling GUI.TextArea with Screen Size](http://stackoverflow.com/questions/36267658/scaling-gui-textarea-with-screen-size) – Fattie Nov 25 '16 at 13:31
  • 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. – Fattie Nov 25 '16 at 13:32

1 Answers1

5

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.

  • 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? – Anton nelson Nov 02 '15 at 00:09
  • 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. – Jan Ivar Z. Carlsen Nov 02 '15 at 00:36
  • for 2018, it is completely explained here: https://stackoverflow.com/a/36268018/294884 – Fattie May 16 '18 at 16:59