From 3f7a3cf979e5e61ea9a0eac21d5f4e00a15b5218 Mon Sep 17 00:00:00 2001 From: Penelope Date: Sat, 5 Apr 2025 12:18:57 -0300 Subject: [PATCH] End of the lesson 8, Creating Loading scene UI. --- gfx/ui/loading_bar.png | 3 ++ gfx/ui/loading_bar.png.import | 34 ++++++++++++++++++++++ gfx/ui/loading_frame.png | 3 ++ gfx/ui/loading_frame.png.import | 34 ++++++++++++++++++++++ scenes/ui/loading_screen.tscn | 51 +++++++++++++++++++++++++++++++++ themes/default_theme.tres | 1 + 6 files changed, 126 insertions(+) create mode 100644 gfx/ui/loading_bar.png create mode 100644 gfx/ui/loading_bar.png.import create mode 100644 gfx/ui/loading_frame.png create mode 100644 gfx/ui/loading_frame.png.import create mode 100644 scenes/ui/loading_screen.tscn diff --git a/gfx/ui/loading_bar.png b/gfx/ui/loading_bar.png new file mode 100644 index 0000000..a47daf0 --- /dev/null +++ b/gfx/ui/loading_bar.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4fe2b2cfc6ce476ef0ddd25dddfe248f0c73d3a339ac72d72c42238c30423b0 +size 553 diff --git a/gfx/ui/loading_bar.png.import b/gfx/ui/loading_bar.png.import new file mode 100644 index 0000000..4c1c540 --- /dev/null +++ b/gfx/ui/loading_bar.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://df4gfyht0d2r3" +path="res://.godot/imported/loading_bar.png-252a5b8005f6eb7b665969d06ab66b89.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://gfx/ui/loading_bar.png" +dest_files=["res://.godot/imported/loading_bar.png-252a5b8005f6eb7b665969d06ab66b89.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/gfx/ui/loading_frame.png b/gfx/ui/loading_frame.png new file mode 100644 index 0000000..e027ed1 --- /dev/null +++ b/gfx/ui/loading_frame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0b0aa658f9e989008d01bd24d469001cb512fdcfde83c15086e13550bc14cf8 +size 5764 diff --git a/gfx/ui/loading_frame.png.import b/gfx/ui/loading_frame.png.import new file mode 100644 index 0000000..ce54cd1 --- /dev/null +++ b/gfx/ui/loading_frame.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cyw8i4rnh8x5x" +path="res://.godot/imported/loading_frame.png-1749b3ea641b9fd96a6a1960a85787c4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://gfx/ui/loading_frame.png" +dest_files=["res://.godot/imported/loading_frame.png-1749b3ea641b9fd96a6a1960a85787c4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/ui/loading_screen.tscn b/scenes/ui/loading_screen.tscn new file mode 100644 index 0000000..25226a2 --- /dev/null +++ b/scenes/ui/loading_screen.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=4 format=3 uid="uid://c8fyt7v0ksdyc"] + +[ext_resource type="Theme" uid="uid://dnxny0n7ti7eq" path="res://themes/default_theme.tres" id="1_5fj0j"] +[ext_resource type="Texture2D" uid="uid://cyw8i4rnh8x5x" path="res://gfx/ui/loading_frame.png" id="2_s2kth"] +[ext_resource type="Texture2D" uid="uid://df4gfyht0d2r3" path="res://gfx/ui/loading_bar.png" id="3_s41fs"] + +[node name="Loading Screen" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Background" type="ColorRect" parent="."] +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, 1) + +[node name="CenterContainer" type="CenterContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="CenterContainer/VBoxContainer"] +layout_mode = 2 +theme = ExtResource("1_5fj0j") +theme_override_font_sizes/font_size = 30 +text = "Loading..." +horizontal_alignment = 1 + +[node name="Loading Progress" type="TextureProgressBar" parent="CenterContainer/VBoxContainer"] +custom_minimum_size = Vector2(200, 25) +layout_mode = 2 +nine_patch_stretch = true +stretch_margin_left = 1 +stretch_margin_top = 1 +stretch_margin_right = 1 +stretch_margin_bottom = 1 +texture_over = ExtResource("2_s2kth") +texture_progress = ExtResource("3_s41fs") diff --git a/themes/default_theme.tres b/themes/default_theme.tres index a6056fb..81ef0b8 100644 --- a/themes/default_theme.tres +++ b/themes/default_theme.tres @@ -39,3 +39,4 @@ Button/fonts/font = ExtResource("1_lkf7m") Button/styles/hover = SubResource("StyleBoxTexture_r3xux") Button/styles/normal = SubResource("StyleBoxTexture_oxkhk") Button/styles/pressed = SubResource("StyleBoxTexture_pvobe") +Label/fonts/font = ExtResource("1_lkf7m")