20 lines
402 B
GDScript3
20 lines
402 B
GDScript3
|
extends Node2D
|
||
|
|
||
|
var message
|
||
|
var type
|
||
|
|
||
|
func _ready():
|
||
|
if type == "warning":
|
||
|
$Label.add_color_override("font_color", Color(255, 69, 0))
|
||
|
if type == "alert":
|
||
|
$Label.add_color_override("font_color", Color(255, 0, 0))
|
||
|
|
||
|
func _process(delta):
|
||
|
$Label.text = message
|
||
|
|
||
|
func _on_TTL_timeout():
|
||
|
$AnimationPlayer.play("move_off_screen")
|
||
|
|
||
|
func _on_AnimationPlayer_animation_finished(anim_name):
|
||
|
queue_free()
|