poursuite de la finition de l'introduction
This commit is contained in:
+28
-10
@@ -1,26 +1,44 @@
|
||||
extends CanvasLayer
|
||||
|
||||
signal on_fading_finished
|
||||
signal on_transition_finished
|
||||
|
||||
@onready var color_rect = $ColorRect
|
||||
@onready var animation_player = $AnimationPlayer
|
||||
@onready var big_fading = $BigFading
|
||||
@onready var small_fading = $SmallFading
|
||||
@onready var big_animation = $BigFading/BigFadingAnimation
|
||||
@onready var small_animation = $SmallFading/SmallFadingAnimation
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
||||
color_rect.visible = false
|
||||
animation_player.connect("animation_finished", _on_animation_finished)
|
||||
big_fading.visible = false
|
||||
small_fading.visible = false
|
||||
big_animation.connect("animation_finished", _on_animation_finished)
|
||||
small_animation.connect("animation_finished", _on_animation_finished)
|
||||
|
||||
|
||||
func _on_animation_finished(anim_name):
|
||||
if anim_name == "fade_to_black":
|
||||
on_transition_finished.emit()
|
||||
animation_player.play("fade_to_normal")
|
||||
on_fading_finished.emit()
|
||||
big_animation.play("fade_to_normal")
|
||||
small_animation.play("fade_to_normal")
|
||||
|
||||
elif anim_name == "fade_to_normal":
|
||||
color_rect.visible = false
|
||||
on_transition_finished.emit()
|
||||
Globals.is_transitioning = false
|
||||
big_fading.visible = false
|
||||
small_fading.visible = false
|
||||
|
||||
|
||||
|
||||
func transition():
|
||||
color_rect.visible = true
|
||||
animation_player.play("fade_to_black")
|
||||
func transition(size):
|
||||
|
||||
Globals.is_transitioning = true
|
||||
|
||||
if size == "big":
|
||||
big_fading.visible = true
|
||||
big_animation.play("fade_to_black")
|
||||
elif size == "small":
|
||||
small_fading.visible = true
|
||||
small_animation.play("fade_to_black")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user