|
|
|
|
Reply From: |
TheFamousRat |
Hello Tottel,
For Control nodes in Godot, it is generally not a very good idea to change sizes (and, for that matter, anchors and margin) manually. If you really need to do it, check the “Clip Text” checkbox in the Inspector, which will allow you to reduce the size of the button.
Here’s the catch : the HBoxContainer will ALWAYS stretch any of its nodes as much as possible. As such, the size of a button (and its margins and anchors) will get modified automatically every time you update it. As such, any parameters that you put for the size of the button will get overridden. As such, you have to use “Size flags” (it’s a tab in the “Control” part of the Inspector, when looking at the Button).
I tested it right now, and I think that for what you want, unchecking the “Fill” checkbox in the “Vertical” category seems to work. Don’t hesitate to play around with those other checkboxes, if you want your Node to be centered, at the top, at the bottom etc.
As for your question regarding Control as the root, I’m not experienced enough to give you a very valuable and detailed answer but yes, I think it’s a good idea. When building a scene, the root node should always be quite general, and then its childs fill more and more specific roles. For a typical GUI, the Control Node would just be here to fill all the screen, while its childs have more specific purposes (Popups with options, text dialogs etc.).
In the end of course, the best solution is different for every scene, and so you will have to judge what works best yourself. But, for a general scene with a few buttons in a HBoxContainer, yes, a Control node as root node is a good idea.
Hope this helps