Flopsy/scenes/hud.gd
2022-07-17 14:24:15 +02:00

22 lines
598 B
GDScript

extends CanvasLayer
export var font_color : Color = Color(0, 0, 0)
# Called when the node enters the scene tree for the first time.
func _ready():
$HUD_Items/ScoreLabel.add_color_override("font_color", font_color)
func set_score(value):
$HUD_Items/ScoreLabel.text = str(value)
func scene_fadeout():
$SceneTransition/Animation.play_backwards("Fade")
yield($SceneTransition/Animation, "animation_finished")
func hud_visible(value: bool):
$HUD_Items.visible = value
func scene_fadein():
$SceneTransition/Animation.play("Fade")
yield($SceneTransition/Animation, "animation_finished")