I’ve got a VBoxContainer that contains text elements, and is of variable height. I would like to be able to know the height when I add it to the tree, so I can position it. (The control itself is not the child of another container, I want to position it arbitrarily.)
The workaround is to await get_tree().process_frame
so I can get its size (after it goes through the control layout process). I’ve seen suggestions to use container.notification(Container.NOTIFICATION_SORT_CHILDREN)
but this doesn’t update the height of the children (which are Label or RichTextLabel).
Is there a way to do a hypothetical box.perform_all_layout()
instead? (In Unity I used LayoutRebuilder.ForceRebuildLayoutImmediate
for something similar.)