Files
skitter/ui/load_splash.gd
2025-08-12 21:10:23 +12:00

29 lines
653 B
GDScript

extends Control
@onready var children := $Container.get_children()
@export var screen_time : int
@export var fade_curve : Curve
@export var next_scene : PackedScene
var i := 0
var count := 0.0
func _ready() -> void:
for child in children:
child.visible = false
children[i].visible = true
func _process(delta: float) -> void:
count += delta
children[i].modulate = Color(1,1,1,fade_curve.sample(count / screen_time))
children[i].visible = true
if count > screen_time:
count = 0;
children[i].visible = false
i+=1
if i >= len(children):
_next_scene()
func _next_scene() -> void:
get_tree().change_scene_to_packed(next_scene)