This will be a class to handle events, such as custom events implemented in GDScript/Chat Commands, as well as Twitch Events, such as Raids, Shoutouts, etc, etc.
29 lines
831 B
GDScript
29 lines
831 B
GDScript
extends Node
|
|
|
|
var ol: OverlayWindow
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
ol = get_tree().root.get_node("MainWin")
|
|
|
|
|
|
func test_notification(msg: String) -> void:
|
|
var lbl = Label.new()
|
|
lbl.label_settings = LabelSettings.new()
|
|
lbl.label_settings.font_size = 75
|
|
lbl.label_settings.font_color = Color.DODGER_BLUE
|
|
lbl.text = msg
|
|
lbl.modulate.a = 0
|
|
lbl.ready.connect(func() -> void:
|
|
var half: Vector2 = lbl.size / 2
|
|
lbl.position = Vector2(get_tree().root.size / 2) - half
|
|
var tw := create_tween()
|
|
tw.tween_property(lbl, "modulate:a", 1.0, 0.5)
|
|
tw.tween_interval(2.5)
|
|
tw.parallel().tween_property(lbl, "position:y", get_tree().root.size.y + 10, 3.0)
|
|
tw.parallel().tween_property(lbl, "modulate:a", 0, 3.0)
|
|
await tw.finished
|
|
lbl.queue_free()
|
|
)
|
|
add_child(lbl)
|