UI (UGUI) feedback: scalability issues

I think the UI has fundamental issues when it comes to making scalable interfaces.

Basically, there are few things I’d like to point out:

For one thing, there’s no proper grid layout. Horizontal and Vertical layout groups are step in the right direction, and remind me of QVerticalLayout and QHorizontalLayout for qt.

However… grid layout is … uh… really weird in comparison. There’s no way to set grid size, no way to set desired column size, no way to set row/column span for an item. Basically, it is pretty much useless for anything.

Next… several components are designed by assembling gameobjects together. Examples are slider, dropdown, text input, etc. The issue here is two-fold: First, component sizes are often specified in absolute coordinates. For example, slider knob size is specified in pixels, to adjust the size, you’d need to dive into object hierarchy and what it means is that if, say, slider gets suddenly stretched vertically/horiztonally, the knob will shrink. Similar issue happens with dropdown, when suddenly enlarged dropdown still spawns tiny list. Also, UI has amazing functionality called “best fit” for text components, the problem is it is “off” by default pretty much everywhere.

Here’s what I think:

It would be nice if whoever works on unity’s uGui system took a look at qt 5 and spent a month or so working with it and then stole few ideas from there and reapplied them into unity gui.

Basically, I have impression that the idea of unity ui being composed out of gameobjects is not exactly right, and approach where the UI component builds its own mesh (with text, material and all) or work in a fashion similar to Qt’s QPainter class could work much better. After all, digging through children of a text input field in order to adjust text size feels really awkward.

Another thing is that layout system needs to be improved. I think that vertical/horizontal layouts are step in the right direction, but there needs to be an equivalent of a spanner component, and grid layout is poorly implemented. Basically, grid layout should act in a manner similar to html table and not attempt to use fixed sized cells everywhere. There should be mechanisms for cell/column spans, and should be a way to set row coclumn sizes in percentages. Rows and columns should also take minimum, maximum, preferred size into account.

Example of Qt layout system in action can be found here:

3 Likes

I find getting the x to y ratio of UI elements right is also extremely finicky, since due to x and y both being between 0 to 1, having 0.1,0.1 would not produce a square, given non square aspect ratio

I totally agree; the lack of effective flexible layout has been a big problem for me with the ‘new’ UI since day one. Being unable to easily recreate a layout that would be simple - not just ‘easy’, but ‘uncomplex’ - in HTML/CSS is very frustrating.

Having said that, I think various users are starting to try and find ways to work around this, e.g.:

VariableGridLayoutGroup - a custom UI class - Unity Engine - Unity Discussions - “a custom script that allows you to create a grid whose columns and rows are variable sizes, dynamically resizing to fit the largest content in that row or column”

I think the ugui is really easy to work with, you can get some really sophisticated behaviour through composition, and most importantly - its super easy to roll your own layout managers.

I have craploads of complaints about ugui, but in my experience at least - the layout components are fine. The big problem is the recttransform and positioning stuff relative to distant nodes in the hierarchy - that stuff is a real pain. It’s also very frequent when you’re dealing with non traditional gui (like world space indicators that you dont want overlapping with screen space ui).

We shouldn’t need to write a layout manager to get basic table formatting that has been in pretty much every non-game GUI for 20 years. It’s taken a couple of years for someone to write a decent script for it so it can’t have been that straightforward.

1 Like

Err, no, they aren’t fine. At least grid layout definitely isn’t fine.

VBox and HBox… I mean Vertical and Horizontal layouts do their jobs and work as I expected, but GridLayout feels very out of place and does not exhibit expected behavior of a HTML table.

Which is why I recommended to take a look at Qt. QGridLayout is pretty much what I’d like to have in UGui. There’s also matter of spacers, and a bit awkward handling of layout item limits, but those are secondary compared to the behavior of a grid layout.

It would definitely be nice to see any forward looking development on the UI. I am happy with most aspects of it, but I agree that layout and wrangling RectTransform size and relative position to other RectTransforms that aren’t siblings is almost too much work to be worth it. The whole system has been almost untouched since release.

I’m all for seeing more ugui improvements being made

1 Like

Yeah, I get a similar impression. It suits the common game use case of “lets have a rigid grid of same-sized items” like for an inventory screen… and that’s about it.

I find UGUI great when implementing common game-type UIs, but it gets incredibly fiddle very fast as soon as you’re doing something more traditionally WIMP-based.