Files
imnotsick/Scenes/UI/masks.gd
T
2026-03-01 14:10:51 +01:00

30 lines
624 B
GDScript

extends Control
@onready var fading_mask = $FadingMask
@onready var mask = $Mask
signal transition_finished
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass
#Transitions the scenes with a fading mask
func transition(scenes_to_hide, scenes_to_show):
#Fade in
fading_mask.fade_in()
await fading_mask.animation.animation_finished
#Hides and show appropriates scenes
for scene in scenes_to_hide:
scene.hide()
for scene in scenes_to_show:
scene.show()
#Fade out
fading_mask.fade_out()
await fading_mask.animation.animation_finished
transition_finished.emit()