02.designing-the-scoreboard

Designing the score panel

In this first video, we design the high scores panel together.

This involves using Godot’s Control nodes, which are dedicated to the user interface.

Creating user interfaces is complex, so don’t worry if you don’t get all the details from the start. You will use these nodes again in the course and better understand them through practice.

New concepts

Control node

Godot comes with numerous nodes dedicated to user interface (UI) design: the Control nodes. They all have a green icon in the Create New Node window.

To give you an idea of how powerful Control nodes are, everything you see in the Godot editor itself uses them.

When you design user interfaces, you want boxes and widgets that you can nest and combine freely.

Different games and applications need different user interfaces, so UI design systems are often flexible and complex.

This is why Godot’s Control nodes come with many sections and properties in the Inspector.

Each Control node is a resizable box that anchors and resizes relative to a parent box, the largest being the game window.

In the video, you could see that when we selected a node and used Layout -> Full Rect. The four green pins represented the scoreboard’s anchor points.

The distance between the node’s box and those pins defines the node’s margins (the yellow arrows below).

When the player resizes the game window, the scoreboard resizes but keeps fixed margins relative to the game window’s corners.

Containers

Container nodes are a sub-category of Control nodes that automatically reposition and resize their Control children:

Godot comes with all the basic containers to display other Control nodes in rows, columns, grids, etc.

Displaying text with the Label node

The Label node allows you to draw an unformatted line or paragraph of text.

It has settings you can use to capitalize, wrap, or re-align your text.

That’s it for this part. In the next lesson, you’ll display a list of names on the board using only code.