27 lines
552 B
GDScript
27 lines
552 B
GDScript
extends Panel
|
|
class_name Curtain
|
|
|
|
var _tween : Tween = null
|
|
|
|
func _ready() -> void:
|
|
print_debug("curtain.gd: ready()")
|
|
show()
|
|
|
|
func show() -> void:
|
|
visible = true
|
|
print_debug("curtain.gd: show()")
|
|
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()")
|
|
if _tween != null:
|
|
_tween.kill()
|
|
_tween = create_tween()
|
|
_tween.tween_property(self, "modulate:a", 0.0, 1.0)
|
|
await _tween.finished
|
|
visible = false
|