control node flags

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

I’m having an issue where, during run time when the children of a margin container change. The container disregards the size flags scaling and simply grows larger, regardless of if the children could easily fit inside the container without scaling.

This size flags work just find in editor, this only seems to bug during run time.

What version of Godot are you using? I can’t seem to replicate this. What size flags are you using?

exuin | 2021-09-09 16:27

Using 3.3 and I have a HBoxContainer with horizontal flags set at: Expand and Shrink Center.

I then have default buttons that populate inside the container as children during a for loop function. Their H and V flags are both set at 1: Fill

When I put a button as a child manually in the editor and then duplicated it, it updates and just fine and looks great. But when the for loop adds the same button, the Shrink Center flag doesn’t seem to update and it tacks on the button towards the right side of the initially centered button. It either does that OR moves the buttons, but doesn’t resize the buttons down to their text as it should since the buttons don’t have a rect_min_size, this causes the buttons to be large and populate off screen. The whole thing just kind of bugs out when a loop adds to the HBoxContainer in general.

Dumuz | 2021-09-09 23:58