From 48ebd1e9af29f1f51d46c348c43f95fb5dbd0f28 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Sun, 1 Oct 2023 02:20:45 +0200 Subject: [PATCH] added bunny home screen --- scenes/bunny_home/BunnyHome.gd | 11 ++ scenes/bunny_home/BunnyHome.tscn | 193 +++++++++++++++++++++++++++++++ scenes/main_menu/MainMenu.gd | 3 + scenes/main_menu/MainMenu.tscn | 15 +-- 4 files changed, 215 insertions(+), 7 deletions(-) create mode 100644 scenes/bunny_home/BunnyHome.gd create mode 100644 scenes/bunny_home/BunnyHome.tscn diff --git a/scenes/bunny_home/BunnyHome.gd b/scenes/bunny_home/BunnyHome.gd new file mode 100644 index 0000000..b7b1ec8 --- /dev/null +++ b/scenes/bunny_home/BunnyHome.gd @@ -0,0 +1,11 @@ +extends Control + +signal scene_changed(scene_name) + +func _notification(what): + if what == NOTIFICATION_WM_GO_BACK_REQUEST: + _on_Back_pressed() + +func _on_Back_pressed(): + # return to menu + emit_signal("scene_changed", "res://scenes/main_menu/MainMenu.tscn") diff --git a/scenes/bunny_home/BunnyHome.tscn b/scenes/bunny_home/BunnyHome.tscn new file mode 100644 index 0000000..ed9df0d --- /dev/null +++ b/scenes/bunny_home/BunnyHome.tscn @@ -0,0 +1,193 @@ +[gd_scene load_steps=23 format=3 uid="uid://cm4jtmoi2p0hv"] + +[ext_resource type="Script" path="res://scenes/bunny_home/BunnyHome.gd" id="1_hpexc"] +[ext_resource type="Shader" path="res://themes/default/backgrounds/home_screen_dots.gdshader" id="1_s32h5"] +[ext_resource type="Texture2D" uid="uid://br55agyqqfkg7" path="res://themes/default/resources/bunny_loading_spritesheet.png" id="2_jy3fr"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_sofd1"] +shader = ExtResource("1_s32h5") +shader_parameter/dots_color = Vector4(1, 0.82, 0.78, 1) +shader_parameter/radius = 0.09 +shader_parameter/grid_size = 6.0 +shader_parameter/speed = 0.25 + +[sub_resource type="AtlasTexture" id="AtlasTexture_pk1gk"] +atlas = ExtResource("2_jy3fr") +region = Rect2(0, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hqkjm"] +atlas = ExtResource("2_jy3fr") +region = Rect2(277, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0nhkx"] +atlas = ExtResource("2_jy3fr") +region = Rect2(554, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hs3dr"] +atlas = ExtResource("2_jy3fr") +region = Rect2(831, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pm4ta"] +atlas = ExtResource("2_jy3fr") +region = Rect2(1108, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pv8uk"] +atlas = ExtResource("2_jy3fr") +region = Rect2(1385, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4r5m5"] +atlas = ExtResource("2_jy3fr") +region = Rect2(1662, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jaqog"] +atlas = ExtResource("2_jy3fr") +region = Rect2(1939, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_x67gc"] +atlas = ExtResource("2_jy3fr") +region = Rect2(2216, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_n2ypl"] +atlas = ExtResource("2_jy3fr") +region = Rect2(2493, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0qnw5"] +atlas = ExtResource("2_jy3fr") +region = Rect2(2770, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4nkb6"] +atlas = ExtResource("2_jy3fr") +region = Rect2(3047, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_25kc0"] +atlas = ExtResource("2_jy3fr") +region = Rect2(3324, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_md53l"] +atlas = ExtResource("2_jy3fr") +region = Rect2(3601, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_20mcp"] +atlas = ExtResource("2_jy3fr") +region = Rect2(3878, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_khi20"] +atlas = ExtResource("2_jy3fr") +region = Rect2(4155, 0, 277, 140) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5ixfp"] +atlas = ExtResource("2_jy3fr") +region = Rect2(4432, 0, 277, 140) + +[sub_resource type="SpriteFrames" id="SpriteFrames_y5nt5"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_pk1gk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hqkjm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0nhkx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hs3dr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pm4ta") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pv8uk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4r5m5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jaqog") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_x67gc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_n2ypl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0qnw5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4nkb6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_25kc0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_md53l") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_20mcp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_khi20") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5ixfp") +}], +"loop": true, +"name": &"bunny_loading", +"speed": 10.0 +}] + +[node name="BunnyHome" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_hpexc") + +[node name="Background" type="ColorRect" parent="."] +material = SubResource("ShaderMaterial_sofd1") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +color = Color(1, 0.858824, 0.827451, 1) + +[node name="Title" type="Label" parent="."] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -317.0 +offset_top = 100.0 +offset_right = 317.0 +offset_bottom = 277.0 +grow_horizontal = 2 +size_flags_horizontal = 4 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_font_sizes/font_size = 144 +text = "Bunny House" +vertical_alignment = 1 + +[node name="BunnyLoadingContainer" type="CenterContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_vertical = 4 + +[node name="Control" type="Control" parent="BunnyLoadingContainer"] +layout_mode = 2 + +[node name="BunnyLoadingAnimatedSprite" type="AnimatedSprite2D" parent="BunnyLoadingContainer/Control"] +scale = Vector2(3, 3) +sprite_frames = SubResource("SpriteFrames_y5nt5") +animation = &"bunny_loading" +autoplay = "bunny_loading" diff --git a/scenes/main_menu/MainMenu.gd b/scenes/main_menu/MainMenu.gd index cb85d7f..81aa8e0 100644 --- a/scenes/main_menu/MainMenu.gd +++ b/scenes/main_menu/MainMenu.gd @@ -17,6 +17,9 @@ func _on_calendar_button_pressed(): func _on_store_button_pressed(): change_scene("res://scenes/store/Store.tscn") +func _on_bunnyHome_button_pressed(): + change_scene("res://scenes/bunny_home/BunnyHome.tscn") + func _on_menu_button_scene_changed(scene_name): change_scene(scene_name) diff --git a/scenes/main_menu/MainMenu.tscn b/scenes/main_menu/MainMenu.tscn index 4774d2a..448e9b6 100644 --- a/scenes/main_menu/MainMenu.tscn +++ b/scenes/main_menu/MainMenu.tscn @@ -122,20 +122,21 @@ grow_horizontal = 1 grow_vertical = 1 text = "Calendar" -[node name="StoreBtn" parent="VBoxContainer/VSplitContainer/BottomCenterContainer" instance=ExtResource("4_71840")] +[node name="BunnyHomeBtn" parent="VBoxContainer/VSplitContainer/BottomCenterContainer" instance=ExtResource("4_71840")] layout_mode = 2 -[node name="Button" parent="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn" index="0"] +[node name="Button" parent="VBoxContainer/VSplitContainer/BottomCenterContainer/BunnyHomeBtn" index="0"] offset_left = -418.0 offset_top = 450.0 offset_right = -49.0 offset_bottom = 804.0 -text = "Store" +text = "Bunny +Home" -[node name="StoreBtn2" parent="VBoxContainer/VSplitContainer/BottomCenterContainer" instance=ExtResource("4_71840")] +[node name="StoreBtn" parent="VBoxContainer/VSplitContainer/BottomCenterContainer" instance=ExtResource("4_71840")] layout_mode = 2 -[node name="Button" parent="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn2" index="0"] +[node name="Button" parent="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn" index="0"] offset_left = 51.0 offset_top = 450.0 offset_right = 420.0 @@ -152,11 +153,11 @@ scale = Vector2(2, 2) [connection signal="pressed" from="VBoxContainer/VSplitContainer/BottomCenterContainer/ToDoBtn/Button" to="." method="_on_to_do_button_pressed"] [connection signal="pressed" from="VBoxContainer/VSplitContainer/BottomCenterContainer/CalendarBtn/Button" to="." method="_on_calendar_button_pressed"] +[connection signal="pressed" from="VBoxContainer/VSplitContainer/BottomCenterContainer/BunnyHomeBtn/Button" to="." method="_on_bunnyHome_button_pressed"] [connection signal="pressed" from="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn/Button" to="." method="_on_store_button_pressed"] -[connection signal="pressed" from="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn2/Button" to="." method="_on_store_button_pressed"] [connection signal="scene_changed" from="MenuButton" to="." method="_on_menu_button_scene_changed"] [editable path="VBoxContainer/VSplitContainer/BottomCenterContainer/ToDoBtn"] [editable path="VBoxContainer/VSplitContainer/BottomCenterContainer/CalendarBtn"] +[editable path="VBoxContainer/VSplitContainer/BottomCenterContainer/BunnyHomeBtn"] [editable path="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn"] -[editable path="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn2"] -- 2.30.2