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

36 lines
849 B
GDScript

extends Panel
class_name Curtain
var _tween : Tween = null
func _ready() -> void:
print_debug("curtain.gd: ready()")
visible = true
## Conceals the Game Stage
func close() -> void:
visible = true
print_debug("curtain.gd: show()")
if _tween: _tween.kill()
_tween = create_tween()
_tween.tween_property(self, "modulate", Color.WHITE, 0.7)
await _tween.finished
## Conceals the Game Stage
func black() -> void:
visible = true
print_debug("curtain.gd: show()")
if _tween: _tween.kill()
_tween = create_tween()
_tween.tween_property(self, "modulate", Color.BLACK, 0.7)
await _tween.finished
## Makes the Game Stage Visible
func open() -> void:
print_debug("curtain.gd: hide()")
if _tween: _tween.kill()
_tween = create_tween()
_tween.tween_property(self, "modulate", Color.TRANSPARENT, 0.7)
await _tween.finished
visible = false