init
This commit is contained in:
15
gui/scene_transition/scene_transition.gd
Normal file
15
gui/scene_transition/scene_transition.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var animation_player: AnimationPlayer = $Control/AnimationPlayer
|
||||
|
||||
func fade_out() -> bool:
|
||||
animation_player.play("fade_out")
|
||||
await animation_player.animation_finished
|
||||
return true
|
||||
|
||||
func fade_in() -> bool:
|
||||
animation_player.play("fade_in")
|
||||
await animation_player.animation_finished
|
||||
return true
|
||||
|
||||
|
||||
1
gui/scene_transition/scene_transition.gd.uid
Normal file
1
gui/scene_transition/scene_transition.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bj8b41e1xb3uq
|
||||
98
gui/scene_transition/scene_transition.tscn
Normal file
98
gui/scene_transition/scene_transition.tscn
Normal file
@@ -0,0 +1,98 @@
|
||||
[gd_scene format=3 uid="uid://c4iyg64sd02rx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bj8b41e1xb3uq" path="res://gui/scene_transition/scene_transition.gd" id="1_yvyfr"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ex1eg"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("ColorRect:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_yvyfr"]
|
||||
resource_name = "default"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("ColorRect:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_jxmsx"]
|
||||
resource_name = "fade_in"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("ColorRect:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ivw6h"]
|
||||
resource_name = "fade_out"
|
||||
length = 0.2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("ColorRect:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7lt87"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_ex1eg"),
|
||||
&"default": SubResource("Animation_yvyfr"),
|
||||
&"fade_in": SubResource("Animation_jxmsx"),
|
||||
&"fade_out": SubResource("Animation_ivw6h")
|
||||
}
|
||||
|
||||
[node name="SceneTransition" type="CanvasLayer" unique_id=1326424867]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_yvyfr")
|
||||
|
||||
[node name="Control" type="Control" parent="." unique_id=358311519]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Control" unique_id=1705459741]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Control" unique_id=418775104]
|
||||
libraries/ = SubResource("AnimationLibrary_7lt87")
|
||||
autoplay = &"default"
|
||||
Reference in New Issue
Block a user