small changes
This commit is contained in:
@@ -14,20 +14,26 @@ signal transition_finished
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
||||
#Hiding masks
|
||||
big_fading.visible = false
|
||||
small_fading.visible = false
|
||||
mask.visible = false
|
||||
|
||||
#Connecting signals
|
||||
big_animation.connect("animation_finished", _on_animation_finished)
|
||||
small_animation.connect("animation_finished", _on_animation_finished)
|
||||
|
||||
|
||||
|
||||
func _on_animation_finished(anim_name):
|
||||
|
||||
#Fades back to normal when fade_to_black is done
|
||||
if anim_name == "fade_to_black":
|
||||
fading_finished.emit()
|
||||
big_animation.play("fade_to_normal")
|
||||
small_animation.play("fade_to_normal")
|
||||
|
||||
|
||||
#Resets everything when fading_to_normal is done
|
||||
elif anim_name == "fade_to_normal":
|
||||
transition_finished.emit()
|
||||
Globals.is_transitioning = false
|
||||
@@ -53,10 +59,11 @@ func fading(size):
|
||||
#Transitions the scenes
|
||||
func transition(fading_screen_size, scenes_to_hide, scenes_to_show):
|
||||
|
||||
#Fade in and out
|
||||
fading(fading_screen_size)
|
||||
|
||||
await self.fading_finished
|
||||
|
||||
#When the screen is black from fading, change the shown scenes before it fades back to normal
|
||||
for scene in scenes_to_hide:
|
||||
scene.hide()
|
||||
for scene in scenes_to_show:
|
||||
|
||||
Reference in New Issue
Block a user