Files
boatgame/scripts/hud.gd
T
2026-07-07 10:01:56 +02:00

28 lines
539 B
GDScript

class_name Hud
extends CanvasLayer
## The HUD's only inputs. Everything inside hud.tscn gets its references
## from here -- nothing inside the scene reaches out on its own.
@export var boat: Boat:
set(value):
boat = value
if is_node_ready():
_distribute()
@export var world: WorldManager:
set(value):
world = value
if is_node_ready():
_distribute()
@onready var _stats_label: Label = %StatsLabel
func _ready() -> void:
_distribute()
func _distribute() -> void:
_stats_label.boat = boat
_stats_label.world = world