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

27 lines
601 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()")
2026-01-18 20:53:19 +00:00
visible = true
2026-01-18 20:53:19 +00:00
## Conceals the Game Stage
func close() -> void:
visible = true
print_debug("curtain.gd: show()")
2026-01-18 20:53:19 +00:00
if _tween: _tween.kill()
2025-12-15 16:57:26 +00:00
_tween = create_tween()
2026-01-18 20:53:19 +00:00
_tween.tween_property(self, "modulate:a", 1.0, 0.7)
2025-12-15 16:57:26 +00:00
await _tween.finished
2026-01-18 20:53:19 +00:00
## Makes the Game Stage Visible
func open() -> void:
print_debug("curtain.gd: hide()")
2026-01-18 20:53:19 +00:00
if _tween: _tween.kill()
2025-12-15 16:57:26 +00:00
_tween = create_tween()
2026-01-18 20:53:19 +00:00
_tween.tween_property(self, "modulate:a", 0.0, 0.7)
2025-12-15 16:57:26 +00:00
await _tween.finished
visible = false