SeptemberGameAB/scripts/ui.gd

16 lines
610 B
GDScript3
Raw Normal View History

class_name UI
extends Control
@onready var health_label: Label = $VBoxContainer/HBoxContainer/MarginContainer/HealthLabel
@onready var timer_label: Label = $VBoxContainer/HBoxContainer/MarginContainer2/TimerLabel
@onready var coins_label: Label = $VBoxContainer/HBoxContainer/MarginContainer3/CoinsLabel
func update_health(current_health, max_health) -> void:
health_label.text = "Health: " + str(current_health)
func update_timer(time_remaining) -> void:
timer_label.text = "Time: " + str(time_remaining)
func update_coins(coins_remaining) -> void:
coins_label.text = "Coins: " + str(coins_remaining)