36 lines
804 B
GDScript
36 lines
804 B
GDScript
extends Control
|
|
|
|
var window_tween
|
|
|
|
|
|
func _ready() -> void:
|
|
Triggerer.listen("show_info", _show_info_window)
|
|
Triggerer.listen("hide_info", _hide_info_window)
|
|
scale = Vector2.ZERO
|
|
|
|
|
|
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, 0.5)
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
if Input.is_action_just_pressed("rclick"):
|
|
_hide_info_window({})
|
|
|
|
|
|
func _hide_info_window(_data):
|
|
if window_tween:
|
|
window_tween.kill()
|
|
|
|
window_tween = create_tween()
|
|
window_tween.set_ease(Tween.EASE_IN)
|
|
window_tween.set_trans(Tween.TRANS_QUAD)
|
|
window_tween.tween_property(self, "scale", Vector2.ZERO, 0.25)
|