Files
imnotsick/Scenes/transition_screen/transition_screen.gd
T
2026-02-27 16:29:12 +01:00

31 lines
670 B
GDScript

extends CanvasLayer
@onready var fading_mask = $FadingMask
@onready var its_game_over = $ITSGameOver
@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()