brackeys-12/info_window.gd
2024-09-13 20:09:38 -04:00

28 lines
590 B
GDScript

extends Control
var window_tween
func _ready() -> void:
Triggerer.listen("show_info", _show_info_window)
Triggerer.listen("hide_info", _hide_info_window)
func _show_info_window(data):
visible = true
if window_tween:
window_tween.kill()
window_tween = create_tween()
window_tween.set_ease(Tween.EASE_OUT)
window_tween.set_trans(Tween.TRANS_BACK)
window_tween.tween_property(self, "scale", Vector2.ONE, 1)
func _hide_info_window(_data):
if window_tween:
window_tween.kill()
window_tween = create_tween()
window_tween.tween_property(self, "scale", Vector2.ZERO, 1)