extends CanvasLayer

signal transitioned

func _ready() -> void:
	$AnimationPlayer.play("fade_to_normal")

func transition() -> void:
	$AnimationPlayer.play("fade_to_black")
	Log.pr("Fading to black")

func _on_animation_player_animation_finished(anim_name : StringName) -> void:
	if anim_name == "fade_to_black":
		Log.pr("Sending transitioned signal...")
		emit_signal("transitioned")
		$AnimationPlayer.play("fade_to_normal")
	if anim_name == "fade_to_normal":
		Log.pr("Faded to normal")
	