add animated splash screen with orbitron font, transition to dashboard
This commit is contained in:
parent
12b8fee0b0
commit
6d64c7ea15
5 changed files with 127 additions and 2 deletions
BIN
assets/fonts/Orbitron.ttf
Normal file
BIN
assets/fonts/Orbitron.ttf
Normal file
Binary file not shown.
|
|
@ -13,7 +13,7 @@ config_version=5
|
||||||
config/name="V Panel"
|
config/name="V Panel"
|
||||||
config/description="A fancy real-time status monitor built with Godot Engine."
|
config/description="A fancy real-time status monitor built with Godot Engine."
|
||||||
config/version="0.1.0"
|
config/version="0.1.0"
|
||||||
run/main_scene="res://scenes/dashboard.tscn"
|
run/main_scene="res://scenes/splash.tscn"
|
||||||
config/features=PackedStringArray("4.6", "Forward Plus")
|
config/features=PackedStringArray("4.6", "Forward Plus")
|
||||||
config/icon="res://assets/icons/icon.svg"
|
config/icon="res://assets/icons/icon.svg"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ func _ready() -> void:
|
||||||
if Engine.is_editor_hint():
|
if Engine.is_editor_hint():
|
||||||
_set_background()
|
_set_background()
|
||||||
return
|
return
|
||||||
get_window().mode = Window.MODE_FULLSCREEN
|
|
||||||
_set_background()
|
_set_background()
|
||||||
_add_modules()
|
_add_modules()
|
||||||
|
|
||||||
|
|
|
||||||
53
scenes/splash.gd
Normal file
53
scenes/splash.gd
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
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()
|
||||||
73
scenes/splash.tscn
Normal file
73
scenes/splash.tscn
Normal file
|
|
@ -0,0 +1,73 @@
|
||||||
|
[gd_scene format=3 uid="uid://dtyq3y052sm8r"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scenes/splash.gd" id="1"]
|
||||||
|
[ext_resource type="FontFile" path="res://assets/fonts/Orbitron.ttf" id="2"]
|
||||||
|
[ext_resource type="Theme" path="res://themes/default_theme.tres" id="3"]
|
||||||
|
|
||||||
|
[sub_resource type="FontVariation" id="FontVariation_ijphb"]
|
||||||
|
base_font = ExtResource("2")
|
||||||
|
variation_settings = {
|
||||||
|
"weight": 900
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="FontVariation" id="FontVariation_boeqg"]
|
||||||
|
base_font = ExtResource("2")
|
||||||
|
variation_settings = {
|
||||||
|
"weight": 600
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="Splash" type="Control"]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
theme = ExtResource("3")
|
||||||
|
script = ExtResource("1")
|
||||||
|
|
||||||
|
[node name="Bg" type="ColorRect" parent="."]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
mouse_filter = 2
|
||||||
|
color = Color(0.08, 0.08, 0.12, 1.0)
|
||||||
|
|
||||||
|
[node name="Center" type="CenterContainer" parent="."]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
mouse_filter = 2
|
||||||
|
|
||||||
|
[node name="TextContainer" type="VBoxContainer" parent="Center"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 4
|
||||||
|
size_flags_vertical = 4
|
||||||
|
theme_override_constants/separation = 0
|
||||||
|
|
||||||
|
[node name="VLabel" type="Label" parent="Center/TextContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_fonts/normal_font = SubResource("FontVariation_ijphb")
|
||||||
|
theme_override_font_sizes/normal_font_size = 128
|
||||||
|
theme_override_colors/font_color = Color(0.933, 0.271, 0.376, 1.0)
|
||||||
|
theme_override_constants/outline_size = 4
|
||||||
|
theme_override_colors/font_outline_color = Color(0.0, 0.0, 0.0, 0.6)
|
||||||
|
text = "V"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="PanelLabel" type="Label" parent="Center/TextContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_fonts/normal_font = SubResource("FontVariation_boeqg")
|
||||||
|
theme_override_font_sizes/normal_font_size = 72
|
||||||
|
theme_override_colors/font_color = Color(0.7, 0.7, 0.8, 1.0)
|
||||||
|
theme_override_constants/outline_size = 2
|
||||||
|
theme_override_colors/font_outline_color = Color(0.0, 0.0, 0.0, 0.5)
|
||||||
|
text = "Panel"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="TransitionOverlay" type="ColorRect" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
mouse_filter = 2
|
||||||
|
color = Color(0, 0, 0, 0)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue