53 lines
1.7 KiB
GDScript
53 lines
1.7 KiB
GDScript
extends Control
|
|
|
|
|
|
@onready var text_container: VBoxContainer = %TextContainer
|
|
@onready var transition_overlay: ColorRect = %TransitionOverlay
|
|
|
|
|
|
func _ready() -> void:
|
|
if not Engine.is_editor_hint():
|
|
get_window().mode = Window.MODE_FULLSCREEN
|
|
|
|
# Initial state: hidden text container, black overlay
|
|
text_container.modulate = Color(1, 1, 1, 0)
|
|
text_container.scale = Vector2(0.25, 0.25)
|
|
transition_overlay.color = Color(0, 0, 0, 1)
|
|
|
|
# Let the layout settle
|
|
await get_tree().process_frame
|
|
await get_tree().create_timer(0.2).timeout
|
|
|
|
# Fade overlay away (reveal splash on a clean background)
|
|
var reveal := create_tween()
|
|
reveal.tween_property(transition_overlay, "color", Color(0, 0, 0, 0), 0.4)
|
|
await reveal.finished
|
|
|
|
# Phase 1: Zoom in and fade in
|
|
var zoom_in := create_tween()
|
|
zoom_in.set_parallel(true)
|
|
zoom_in.tween_property(text_container, "modulate", Color(1, 1, 1, 1), 1.5).set_ease(Tween.EASE_OUT)
|
|
zoom_in.tween_property(text_container, "scale", Vector2(1.0, 1.0), 1.8).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC)
|
|
await zoom_in.finished
|
|
|
|
# Phase 2: Hold
|
|
await get_tree().create_timer(1.0).timeout
|
|
|
|
# Phase 3: Fade out
|
|
var fade_out := create_tween()
|
|
fade_out.tween_property(text_container, "modulate", Color(1, 1, 1, 0), 1.0).set_ease(Tween.EASE_IN)
|
|
await fade_out.finished
|
|
|
|
# Phase 4: Crossfade to dashboard
|
|
var to_black := create_tween()
|
|
to_black.tween_property(transition_overlay, "color", Color(0, 0, 0, 1), 0.4)
|
|
await to_black.finished
|
|
|
|
var dashboard := preload("res://scenes/dashboard.tscn").instantiate()
|
|
add_child(dashboard)
|
|
|
|
var from_black := create_tween()
|
|
from_black.tween_property(transition_overlay, "color", Color(0, 0, 0, 0), 0.6)
|
|
await from_black.finished
|
|
|
|
queue_free()
|