Using the new flex UI beta, when you use a UIFlexItem in a GuiObject, its size may not initialize correctly. You will have to resize the viewport to force the object to update to its correct size. Below is a video showing the issue. A Play Solo session had just started a few seconds prior to the recording. You can see an experience bar that is overlapping another UI element. Once I resize the viewport by dragging its bottom edge the bar is resized correctly.
Here is the relevant piece of the UI’s hierarchy. There are three elements present inside a UIListLayout container. The experience bar - BarContainer - has a LayoutOrder which puts it in the middle between two elements that have a pre-defined size (using Scale and Offset). The experience bar contains a UIFlexItem with FlexMode set to Fill.
Well, the thing is it still does not work. Just to note, same goes for UIListLayout (with it’s HorizontalFlex and VerticalFlex properties). When GUI is initialized, calculations fail, but after resizing, it fixes itself. Even simply selecting the item fixes it but the gui is off when initialized.
Structure:
Studio:
Hitting play:
The problem is, it does not work with Plugins either!
Haven’t been in Studio for a while so I cannot really test it but I can say that the plugin GUI looks good right after opening so I guess it is fixed. Thanks a lot!
I may have incorrectly assumed that the bug is fixed because this week I noticed some more related issues. Similar to the video I posted in the original bug report, the two UI elements are once again sometimes overlapping until I resize my viewport to force an update.
I also noticed a related issue where updating the size of the viewport would prevent text from scaling correctly if TextScaled is true and the label has a UIFlex child. This is best seen in the emulator view. E.g. here in this video you can see my text scaling in all sorts of weird ways.
When I switch from a large screen size to a small screen size my text scales to become a lot smaller than it should be.
I think this is caused by the same bug, but please let me know if I should file a separate bug report for this problem.
You are correct, thanks for flagging this! We had a temporary regression for the last 2 weeks, but I turned on a fix today. Please let us know if the reported issues are fixed!