Download

How to make empty text blocks not take up any space in a widget

Hi, I’m currently working on a widget to display different blocks of information. The player can choose which blocks he wants to see by using toggles. Right now I have a vertical box with one text block for each block of info, and the text of each block is binded to a C++ function. The problem is that I want all the selected blocks to be displayed together, but each non selected block takes up a blank space in the panel.

If this is the info to show:
0

This is how it looks now:
1

This is the how I want it to look:
2

So what I would like to achieve is that empty text blocks don’t take up any space in my panel. I need to keep the text blocks because they are C++ properties binded to the widget, but I can change the panel or add other elements, I just need the information to be displayed as a list and with the format I mentioned.

Set their Visibility to Collapsed.

1 Like

Thanks, It worked!

1 Like