fix: sequential transition — splash fully fades before dashboard appears
This commit is contained in:
parent
5c94f8bf8c
commit
75b9f8cf7b
1 changed files with 9 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue