extends CanvasLayer

# This features only fade in and fade out for now but adding more transitions shouldn't be too hard

func start(anim):
	global.in_transition = true
	$AnimationPlayer.play(anim)
	$AnimationPlayer.connect("animation_finished",self,"on_animation_finished")

func on_animation_finished(anim):
	global.in_transition = false
	match anim:
		"fade_out":
			$AnimationPlayer.play("fade_in")
		"fade_in":
			queue_free()
