fix: sequential transition — splash fully fades before dashboard appears

This commit is contained in:
Eric Smith 2026-05-20 22:35:43 -04:00
parent 5c94f8bf8c
commit 75b9f8cf7b

View file

@ -51,19 +51,19 @@ func _ready() -> void:
# Phase 2: Hold
await get_tree().create_timer(1.0).timeout
# Phase 3: Crossfade to dashboard
# The splash and dashboard share the same background color, so the
# transition is seamless — splash text fades out while dashboard
# modules materialise out of the same dark backdrop.
# Phase 3: Fade out splash text first
var fade_out := create_tween()
fade_out.tween_property(vbox, "modulate", Color(1, 1, 1, 0), 1.0).set_ease(Tween.EASE_IN)
await fade_out.finished
# Phase 4: Then fade dashboard in
var dashboard := preload("res://scenes/dashboard.tscn").instantiate()
add_child(dashboard)
dashboard.modulate = Color(1, 1, 1, 0)
var crossfade := create_tween()
crossfade.set_parallel(true)
crossfade.tween_property(vbox, "modulate", Color(1, 1, 1, 0), 1.0).set_ease(Tween.EASE_IN)
crossfade.tween_property(dashboard, "modulate", Color(1, 1, 1, 1), 1.0).set_ease(Tween.EASE_OUT).set_delay(0.2)
await crossfade.finished
var fade_in := create_tween()
fade_in.tween_property(dashboard, "modulate", Color(1, 1, 1, 1), 1.0).set_ease(Tween.EASE_OUT)
await fade_in.finished
# Reparent dashboard from splash to root, then free splash.
remove_child(dashboard)