Two itemlists alongside each other, to take up the whole screen.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Farflame

I’m really liking what I see with the UI elements in Godot, it’s looking perfect for my game (a Soccer management game with LOTS of UI stuff). Right now though, I’m really struggling to get to grips with the containers. I can see what they’re trying to do but I just can’t get the correct settings to get them to behave how I want them.

So for a simple example, I have two itemlists, which should be identical in size and take up half a screen each. If the screen expands etc I want them to stretch equally, one to the left, one to the right. I put them in a Hsplitcontainer but I just can’t find the right combination of set flags to get them to do this. I assume this is fairly common, so does anyone know the correct settings for this?

:bust_in_silhouette: Reply From: flurick

Yeah the defaults are a bit weird, unless you are placing everything manually in a fixed sized window I guess. I usually end up setting the Layout to Full Rect and checking the flags Fill and Expand for both Horizontal and Vertical.

I was originally placing everything manually, but I saw tutorials on this and it does look like the right path to go down for a game with lots of UI. I was already starting to wonder about screen sizes and stuff and this might solve a lot of it. Looks a bit 'HTML’y where you just tell it what to display and it fits it in as best as possible, something that I really like about HTML.

I’ll try your ideas and see how I get on. Thanks.

Farflame | 2018-10-31 17:48