[gd_scene load_steps=4 format=3 uid="uid://dy4yl1paa8whs"]

[ext_resource type="Texture2D" uid="uid://bglfaie21avpt" path="res://ui/vignette.png" id="1_nb4k0"]

[sub_resource type="Shader" id="Shader_ykyjo"]
code = "shader_type canvas_item;
global uniform float game_over_percentage = 0.0;

void vertex() {
	// Called for every vertex the material is visible on.
}

void fragment() {
	COLOR.r = COLOR.g = COLOR.b = 0.0;
	COLOR.a = clamp(COLOR.a + game_over_percentage * 2.0 - 1.0, 0.0, 1.0);
}

//void light() {
//	// Called for every pixel for every light affecting the CanvasItem.
//	// Uncomment to replace the default light processing function with this one.
//}
"

[sub_resource type="ShaderMaterial" id="ShaderMaterial_uxov2"]
shader = SubResource("Shader_ykyjo")

[node name="CanvasLayer" type="GameUI"]

[node name="Vignette" type="TextureRect" parent="."]
material = SubResource("ShaderMaterial_uxov2")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource("1_nb4k0")
expand_mode = 2

[node name="MessageLabel" type="RichTextLabel" parent="."]
unique_name_in_owner = true
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 195.0
grow_horizontal = 2
theme_override_font_sizes/normal_font_size = 60
text = "Good Luck!"
horizontal_alignment = 1
vertical_alignment = 1

[node name="ClearMessageTimer" type="Timer" parent="MessageLabel"]
unique_name_in_owner = true
wait_time = 5.0
one_shot = true
autostart = true
ignore_time_scale = true

[connection signal="timeout" from="MessageLabel/ClearMessageTimer" to="MessageLabel" method="set_text" flags=3 binds= [""]]
