29 lines
627 B
GDScript
29 lines
627 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.
|
|
|
|
var boat: Boat: # Controlled by PlayerController TODO: Testing values, different label for different types
|
|
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
|