119 lines
3.0 KiB
Plaintext
119 lines
3.0 KiB
Plaintext
[gd_scene load_steps=7 format=3 uid="uid://ct7ccfv6yj73u"]
|
|
|
|
[ext_resource type="Script" uid="uid://dbjei4d2lfwnb" path="res://Scenes/UI/fading_mask.gd" id="2_m3r4n"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_3575e"]
|
|
script/source = "extends CanvasLayer
|
|
|
|
@onready var fading_mask = $FadingMask
|
|
@onready var its_game_over = $ITSGameOver
|
|
@onready var mask = $Mask
|
|
|
|
signal transition_finished
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass
|
|
|
|
|
|
#Transitions the scenes with a fading mask
|
|
func transition(scenes_to_hide, scenes_to_show):
|
|
|
|
#Fade in
|
|
fading_mask.fade_in()
|
|
await fading_mask.animation.animation_finished
|
|
|
|
#Hides and show appropriates scenes
|
|
for scene in scenes_to_hide:
|
|
scene.hide()
|
|
for scene in scenes_to_show:
|
|
scene.show()
|
|
|
|
#Fade out
|
|
fading_mask.fade_out()
|
|
await fading_mask.animation.animation_finished
|
|
transition_finished.emit()
|
|
"
|
|
|
|
[sub_resource type="Animation" id="Animation_n85x3"]
|
|
length = 0.001
|
|
tracks/0/type = "value"
|
|
tracks/0/imported = false
|
|
tracks/0/enabled = true
|
|
tracks/0/path = NodePath("FadingMask:modulate")
|
|
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_20bx3"]
|
|
resource_name = "fade_to_black"
|
|
tracks/0/type = "value"
|
|
tracks/0/imported = false
|
|
tracks/0/enabled = true
|
|
tracks/0/path = NodePath("FadingMask:modulate")
|
|
tracks/0/interp = 1
|
|
tracks/0/loop_wrap = true
|
|
tracks/0/keys = {
|
|
"times": PackedFloat32Array(0, 1),
|
|
"transitions": PackedFloat32Array(1, 1),
|
|
"update": 0,
|
|
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
|
|
}
|
|
|
|
[sub_resource type="Animation" id="Animation_in743"]
|
|
resource_name = "fade_to_normal"
|
|
tracks/0/type = "value"
|
|
tracks/0/imported = false
|
|
tracks/0/enabled = true
|
|
tracks/0/path = NodePath("FadingMask:modulate")
|
|
tracks/0/interp = 1
|
|
tracks/0/loop_wrap = true
|
|
tracks/0/keys = {
|
|
"times": PackedFloat32Array(0, 1),
|
|
"transitions": PackedFloat32Array(1, 1),
|
|
"update": 0,
|
|
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
|
|
}
|
|
|
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5yx4m"]
|
|
_data = {
|
|
&"RESET": SubResource("Animation_n85x3"),
|
|
&"fade_in": SubResource("Animation_20bx3"),
|
|
&"fade_out": SubResource("Animation_in743")
|
|
}
|
|
|
|
[node name="transition_screen" type="CanvasLayer"]
|
|
layer = 98
|
|
script = SubResource("GDScript_3575e")
|
|
|
|
[node name="FadingMask" type="ColorRect" parent="."]
|
|
modulate = Color(0, 0, 0, 0)
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
color = Color(0, 0, 0, 1)
|
|
script = ExtResource("2_m3r4n")
|
|
|
|
[node name="FadingMaskAnimation" type="AnimationPlayer" parent="FadingMask"]
|
|
root_node = NodePath("../..")
|
|
libraries = {
|
|
&"": SubResource("AnimationLibrary_5yx4m")
|
|
}
|
|
|
|
[node name="Mask" type="ColorRect" parent="."]
|
|
visible = false
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
mouse_force_pass_scroll_events = false
|
|
color = Color(0, 0, 0, 0.470588)
|