The problem is, that when I load the scene I cannot click on the button unless I position my mouse between the separation spaces from the HBoxContainer.
Additionally, I resized the button manually to contain the children, is there a way to make it a container so that it automatically adjusts to the size of the children? I’ve always suffered with this and positioning the UI correctly on screen when it’s not a container. It’s a bit confusing.
I have this general problem with buttons and their children. I understand all the control nodes in a separate context. When I try to make them come together like this it just doesn’t work and I don’t understand why. Any help is appreciated.
Buttons are not containers so they will not resize for their children. However, if you make them siblings instead and have another container as the Button’s container, the button will resize to fit the parent container which resizes to fit the other children.
I had the same issue. Instead of PanelContainer use the Panel node.
Then in the code, update its minimum size of the Panel node to reflect the minimum size of the child node, in this example a HBoxContainer.
I recommend doing this with signals.