Topic was automatically imported from the old Question2Answer platform.
Hello all, I’m new on Godot and I want to now what is the best way to create the menus of the game? Using sprites nodes? Interface node? Because I was using Rpg maker and it worked using variables containing the X and Y positions on screen and images/sprites.
The node type you are looking for is called Control.
They are made to register and process all kinds of user input, therefore they are perfect for creating GUI’s (Graphical User Interfaces).
If you look at the documentation you will see there are alot of nodes that inherit properties and functions from the control class.
All of them are designed to be interacted with.
While the RPG Maker uses static images which are displayed infront of the scene on specific X and Y coordinates, Godot has Containers and Size Flags to arrange how the nodes are displayed on the scene.
Lets look at the HBoxContainer for this example. It arranges its children in an horizontal direction with a defined seperation (Found at the tab Custom Constants) and therefore determines the position of them. They can also affect the size of the child nodes.
If you look at the tab Size Flags you will see Fill, Expand, Shrink_Center and Shrink_End for both horizontal and vertical directions. Fill: The node will take all the space it got assigned to from the parent node Expand: The node will take as much space as possible Shrink Center: The node will take the least space possible towards the center Shrink End: The node will take the least space possible towards the end
(They are actually not easy to explain so you better experiment with them around for some time).
Note: Nodes which have a position, have their position relative to their parent.
With that being said, you can pick all kinds of control nodes and combine them together until you get the functionality of desire. You just have to figure out which node structure makes the most sense for positional/size behaviour and coding ease.