A Label on Screen
Part of the Game Rules section of Coddy's Godot journey. Lesson 6 of 29.
A Label node shows text on the screen. Set its text to change what it shows:
$Message.text = "Hello!"Game labels go in a CanvasLayer. It is drawn on top of the game and stays fixed on the screen, even when a camera moves.
Open the Scene tab. This room has a CanvasLayer called HUD (heads up display). It holds an empty Label called Score in the top left corner. Its path from Main is HUD/Score.
Challenge
EasyWhen the game starts, make the label in the corner show Score: 0.
Try it yourself
extends Node2D
func _ready():
pass
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Game Rules
2Score on Screen
A Label on ScreenNumbers into TextFormat with PercentUpdate the LabelA Clock on ScreenPractice on your own: Godot playground