implement splash screens
This commit is contained in:
parent
515434c70c
commit
ac36644d70
8 changed files with 139 additions and 1 deletions
BIN
graphics/hud/godot_splash.png
Normal file
BIN
graphics/hud/godot_splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
35
graphics/hud/godot_splash.png.import
Normal file
35
graphics/hud/godot_splash.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/godot_splash.png-5d8819d8c94270b9158234d3ebb5bf62.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/hud/godot_splash.png"
|
||||||
|
dest_files=[ "res://.import/godot_splash.png-5d8819d8c94270b9158234d3ebb5bf62.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
BIN
graphics/hud/team_sg_splash.png
Normal file
BIN
graphics/hud/team_sg_splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
35
graphics/hud/team_sg_splash.png.import
Normal file
35
graphics/hud/team_sg_splash.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/team_sg_splash.png-23db1fe9018a61fe815d83158426f094.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/hud/team_sg_splash.png"
|
||||||
|
dest_files=[ "res://.import/team_sg_splash.png-23db1fe9018a61fe815d83158426f094.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
38
menus/splash_screen.gd
Normal file
38
menus/splash_screen.gd
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
export var next_screen: PackedScene
|
||||||
|
|
||||||
|
var skipping: bool = false
|
||||||
|
|
||||||
|
onready var team_sg: TextureRect = $TeamSG
|
||||||
|
onready var godot: TextureRect = $Godot
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
yield(get_tree().create_timer(0.5), "timeout")
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
team_sg.visible = true
|
||||||
|
Fade.fade_in(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
yield(get_tree().create_timer(1.0), "timeout")
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
yield(get_tree().create_timer(0.5), "timeout")
|
||||||
|
godot.visible = true
|
||||||
|
Fade.fade_in(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
yield(get_tree().create_timer(1.0), "timeout")
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
_next_screen()
|
||||||
|
|
||||||
|
func _input(event: InputEvent) -> void:
|
||||||
|
if Input.is_action_just_pressed("ui_accept"):
|
||||||
|
skipping = true
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
_next_screen()
|
||||||
|
free()
|
||||||
|
|
||||||
|
func _next_screen() -> void:
|
||||||
|
SceneManager.current_scene = next_screen.instance()
|
29
menus/splash_screen.tscn
Normal file
29
menus/splash_screen.tscn
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
[gd_scene load_steps=5 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://graphics/hud/team_sg_splash.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://menus/splash_screen.gd" type="Script" id=2]
|
||||||
|
[ext_resource path="res://graphics/hud/godot_splash.png" type="Texture" id=3]
|
||||||
|
[ext_resource path="res://menus/title_screen.tscn" type="PackedScene" id=4]
|
||||||
|
|
||||||
|
[node name="SplashScreen" type="Control"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
next_screen = ExtResource( 4 )
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="."]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
color = Color( 0, 0, 0, 1 )
|
||||||
|
|
||||||
|
[node name="TeamSG" type="TextureRect" parent="."]
|
||||||
|
visible = false
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Godot" type="TextureRect" parent="."]
|
||||||
|
visible = false
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
texture = ExtResource( 3 )
|
|
@ -9,6 +9,7 @@ func _input(event):
|
||||||
$AnimationPlayer.play("activate")
|
$AnimationPlayer.play("activate")
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
Fade.fade_in(0.4)
|
||||||
var time = OS.get_time()
|
var time = OS.get_time()
|
||||||
if time.hour >= 18 or time.hour < 6:
|
if time.hour >= 18 or time.hour < 6:
|
||||||
$Night.visible = true
|
$Night.visible = true
|
||||||
|
|
|
@ -69,7 +69,7 @@ _global_script_class_icons={
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Revolution 2083"
|
config/name="Revolution 2083"
|
||||||
run/main_scene="res://menus/title_screen.tscn"
|
run/main_scene="res://menus/splash_screen.tscn"
|
||||||
config/use_custom_user_dir=true
|
config/use_custom_user_dir=true
|
||||||
config/custom_user_dir_name="heromark2"
|
config/custom_user_dir_name="heromark2"
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue