Stretching UI

Hello, the new Unity UI is amazing!
but at times, its pretty hard to set up correctly for a very dynamic screen size.
Honestly, its frustrating to work with the anchor and scaling.
At times it scales negatively, breaks the canvas composition, breaks the text size, dissapearing text, misplaced text, misaligned images/texts, does not work with Vertical/Horizontal, and many more problems.
Is there a way to not use the anchor system?

I want my UI to stretch and scale with any kind of crazy screen resolution.
It doesn’t matter how bad it looks, I just need it to work that way in particular.

I have tried many solution,
Best I have so far is to create actual 3D models for each UI & text mesh,
render it infront of the screen,
and abandon Unity UI.

But do I really have to resort to that?
Am I missing any sort of Unity UI functionality that allows me to do just that?

Illustration (Stretch behavior that I need)


Really, these stretching are a bit extreme, but at least it retains the UI composition, text, alignment, and everything well, which is a HUGE plus for me.

Apart from using one of the Canvas scaler options your only chance will be to multiply all elements sizes by the ratio of the screen… At least considering native functionalities, Unity does not give this option I believe.

I wish it were that simple…
It may work with panels/buttons/images.

But for text,

Unity text either gets smaller, or disappears completely when you re-scale its size.
And also it breaks the number of lines.

I need specifically 4 lines of text to be displayed with the same amount of character at every screen resolution.
But no, Unity UI text will break that.

Also… I have no idea how to code my own Canvas Scaler :sweat_smile:

well… as bad as it might be, you can probably make it work the way you want by multiplying the SCALE of the elements instead of the size of them. If you have a root canvas try to set the scale of it to the ratio of the screen…

edit: tested it and you cannot change the canvas scale but you can put the canvas inside an empty gameobject and scale that object. that will give you the effect you desire :wink: