0 votes

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.

in Engine by (171 points)

2 Answers

+3 votes
Best answer

The easiest is to use GUI nodes (aka Control nodes), because they have most features built-in. I would suggest you read the tutorials about this: http://docs.godotengine.org/en/3.1/getting_started/step_by_step/ui_main_menu.html

by (27,814 points)
selected by
+2 votes

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).

https://docs.godotengine.org/en/3.1/classes/class_control.html
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.

Containers
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.

Size Flags
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.

Good luck :)

by (64 points)

Thx guys, u helped me alot :D

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.