Home > front end >  Unity - Text changes size when changing resolution
Unity - Text changes size when changing resolution

Time:09-22

So, I have a scene where I have some basic elements: a crosshair, a health bar, and a name (a text). I have the canvas set to "scale with screen size" so when I change from, say, 1080p to 4K or GHD, or to a lower resolution, the elements on the UI stay the same size.

The thing is, it only works for the crosshair and the health bar. If I try seeing the game in 4K, the name gets a lot bigger, and if I select a lower resolution it becomes progressively smaller.

Any ideas of what can I do to make the text stay the same size?

Thanks a lot in advance!

The size of the UI at 4K

Size at 1080p

Size at 16:9

CodePudding user response:

Good practice is to use Layout groups , problem on your screen is that some of your elements are set to stretch and some dont.

For exaple this articicle is good. https://medium.com/sketch-app-sources/prototyping-ui-in-unity-part-4-layout-components-9a9451998203

But if you google anything with "layout group Unity" you will find what you need.

  • Related