How best to create grid layouts with varying size components?

E.g.


Or
https://www.gtplanet.net/wp-content/uploads/2016/09/FH3-Expansion-Pass-860x484.jpg

Since UIGridLayout enforces constant size and I’d rather it be adaptable rather than hard coding it.

8 Likes

UIGridLayout is actually specifically designed to support this use case. Simply increase the size of your elements so that they fill multiple cells, and their size will be rounded up to a multiple of the cell size (plus in-between padding).

6 Likes

Nice, Thank you! Could this be added to the wiki entry for UIGridLayout?

2 Likes

It looks like there’s a few bugs, I just gave this a shot myself.

It only worked when I used a UISizeConstraint with MinSize (as opposed to just setting the Size), and it also appeared to not work when you have a UIAspectRatioConstraint parented to the UIGridLayout (which is important if you’re using scale sizing of the CellSize). Additionally, having multi-cell elements causes HorizontalAlignment=center to explode. There were also bugs that caused it to not readjust itself when a cell switched from single-cell to multi-cell as I was editing it. I’ll make sure all of these are filed and that we fix them. I think they’ll be fixed by the new UI backend we’re looking to ship in the coming months.

Yeah, I’ll file a ticket for it.

10 Likes

Thanks, thats probably saved me many hours of head scratching. Guess I’ll put in a hard coded version for now, with the intention to switch after the fixes are live.

1 Like

Ok, I can confirm. UIAspectRatioConstraint really doesn’t like UIGridLayout.


Is there an ETA on this? I’ve been having issues with the constraints that cell sizing has, and combining AspectRatio/SizeConstraint is still dysfunctional. Perhaps cell sizing could be optional? Like how UIListLayouts operate but in both the horizontal and vertical directions.

How is this issue not fixed yet? May you please re-open another ticket or at least give us an update on this issue? An ETA would be nice as @ArcadeRockstar mentioned above. Thanks!

1 Like

I’d also like to know if this is still planned to be fixed. I’m trying to make a grid with AutomaticSize enabled for alternating Y sizes, but I’m unable to use it since UIGridLayout still forces frames to stay the same size.

1 Like

I’m wondering if there are any updates on this? UIGridLayout really should have the option to resize individual cells.

2 Likes

I hope this is still planned because at the moment, elements cannot have specific sizes. I have a use case where I have buttons that auto-size in a grid layout.

3 Likes

Any News?

I think im having the same issue here. Trying to get a ui element to split the buttons up but I cant scale it to do so

1 Like

Still no word on this? Using SizeConstraints with Grid Layouts is causing very weird behaviour. The ability to create elements with different sizes within a grid layout is a missing key feature

Any News?

I know I am having issues with this topic and it seems this post has died without a resolution.