frame-of-mind/src/ui/curtain/curtain.gd

27 lines
552 B
GDScript3
Raw Normal View History

extends Panel
class_name Curtain
2025-12-15 16:57:26 +00:00
var _tween : Tween = null
func _ready() -> void:
print_debug("curtain.gd: ready()")
show()
func show() -> void:
visible = true
print_debug("curtain.gd: show()")
2025-12-15 16:57:26 +00:00
if _tween != null:
_tween.kill()
_tween = create_tween()
_tween.tween_property(self, "modulate:a", 1.0, 1.0)
await _tween.finished
func hide() -> void:
print_debug("curtain.gd: hide()")
2025-12-15 16:57:26 +00:00
if _tween != null:
_tween.kill()
_tween = create_tween()
_tween.tween_property(self, "modulate:a", 0.0, 1.0)
await _tween.finished
visible = false