Question/suggestion about layout system

Hi!

In new UI system you can’t do the following:
“Place number of buttons via scripts to some area. Resize window. Probably your buttons will not be resized or they could be resized but in the way you do not want. For example, I want my buttons to be square form no matter how the window is scaled. But I want them to be scaled if the window size changed.”

I can do that… But with many tricky hacks… I could use layout system (that is practically not mentioned in documentation) and try to change preferred width and/or height of UI elements. However I should determine whether the window size was changed or not(that is a hack too).

So my question is how to do that ? May be I missed something ?
And my suggestion is: Add some element to layout system that allows to do what I described above.

Thanks in advance.

Have you tried using the Reference Resolution component? That resizes while maintaining object aspect ratios.

What you are going to want to do is use a grid layout and a WindowClass script. Whenever the Window is resized have a function in WindowClass check the new width and height of the window and determine what the new Cell Height and Width should be. If the Grid Layout fails to update a quick enable and disable of it should fix it.