Hi, I’ve been working on a learning project to teach myself UI in Godot. I’ve come across absolutely no information as what the “Layout Mode” property of Control nodes does. In the engine, the rollover text only says (paraphrasing): “it can only be set in the Inspector”. Search the net, nothing. Search the docs: nothing. Check the class reference for Control nodes: It’s not in the list of properties, and it’s not in the 4.4, 4.3, 4.2, 4.1, or 4.0 branches of the docs.
This seems to be something that is completely obvious to other people but no-one has bothered to actually write down a description. A quick summary of what it does would be very appeciated.
Thanks.
Internal properties can’t have any documentation because they are not real properties of the object. They are editor only properties.
I’d not worry about the Layout Mode too much. Its use-cases are very limited.
The Layout Mode let you choose how the Control will be positioned/sized. It’s only useful when the Control is a child of another Control node that is not a Container.
If the parent is a Container then the Layout Mode will be forced to Container. The container will position/resize its children.
If the parent is another Control node then you can choose to use Anchors or Position to position/resize the Control node.
Anchors will position/resize the node relative to its anchors (the green pins in the viewport)
Position will position/resize the node using the Transform/Size and Transform/Position values
If the parent is not a Control then the Layout Mode will be forced to Uncontrolled as the engine doesn’t know if the mode Anchors or Position will work and it depends on what the parent node is. You can use both anchors or position to position/resize the Control node.