From a7b1a69c28946eb918a5d0bf0e98e280dbbc62a2 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 28 Oct 2022 15:44:43 -0500 Subject: [PATCH] Commented Notice_message.gd script --- Notice_msg.gd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Notice_msg.gd b/Notice_msg.gd index ed26d8d..cae6473 100644 --- a/Notice_msg.gd +++ b/Notice_msg.gd @@ -1,19 +1,31 @@ extends Node2D +# Define variables (These will be overriden by another script) var message var type +# When everything is loaded, func _ready(): + # If the type is "warning", if type == "warning": + # Add a yellow color override $Label.add_color_override("font_color", Color(255, 69, 0)) + # If the type is "alert", if type == "alert": + # Add a red color override $Label.add_color_override("font_color", Color(255, 0, 0)) +# Every process tick func _process(_delta): + # Set the Label's text to the given message $Label.text = message +# When the TTL timer time's out, func _on_TTL_timeout(): + # Start the move_off_screen animation $AnimationPlayer.play("move_off_screen") +# When animation finishes, func _on_AnimationPlayer_animation_finished(_anim_name): + # Queue_free (AKA, delete) this node queue_free()