Blud_Mage/Scenes/Spawnables/UI/SpawnableUI.gd
2023-10-10 20:26:50 -04:00

18 lines
389 B
GDScript

extends Control
@onready var healthBar : ProgressBar = $HealthBar
@onready var hpLabel : Label = $HealthBar/HP
@onready var timer : Timer = $Timer
func setHP(currentHp, maxHp):
healthBar.min_value = 0
healthBar.max_value = maxHp
healthBar.value = currentHp
hpLabel.text = str(currentHp) + "/" + str(maxHp)
timer.start()
visible = true
func _on_timer_timeout():
visible = false