From 9d8492338eb30db2b5ce5977db0e2581007e07c4 Mon Sep 17 00:00:00 2001 From: Eduardo Fernandez Date: Sun, 24 Sep 2023 21:54:08 +0200 Subject: [PATCH] home buttons styles and positions --- buttons/AnimatedButton.gd | 13 ++++------ scenes/main_menu/MainMenu.tscn | 43 ++++++++++++++++--------------- themes/default/Default_theme.tres | 42 ++++++++++++++++-------------- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/buttons/AnimatedButton.gd b/buttons/AnimatedButton.gd index e52fa3c..345679f 100644 --- a/buttons/AnimatedButton.gd +++ b/buttons/AnimatedButton.gd @@ -9,16 +9,13 @@ func _on_button_button_up(): animate_button_up() func animate_button_down(): - var new_size = Vector2(button.size.x, button.size.y - 10) - var new_position = Vector2(button.position.x, button.position.y + 10) - animate_button(new_size, new_position) + var new_position = Vector2(button.position.x + 8, button.position.y + 8) + animate_button(new_position) func animate_button_up(): - var new_size = Vector2(button.size.x, button.size.y + 10) - var new_position = Vector2(button.position.x, button.position.y - 10) - animate_button(new_size, new_position) + var new_position = Vector2(button.position.x - 8, button.position.y - 8) + animate_button(new_position) -func animate_button(b_size: Vector2, b_position: Vector2): +func animate_button(b_position: Vector2): var tween = get_tree().create_tween().set_parallel(true) - tween.tween_property(button, "size", b_size, 0.05) tween.tween_property(button, "position", b_position, 0.05) diff --git a/scenes/main_menu/MainMenu.tscn b/scenes/main_menu/MainMenu.tscn index 761775c..3a80247 100644 --- a/scenes/main_menu/MainMenu.tscn +++ b/scenes/main_menu/MainMenu.tscn @@ -24,7 +24,8 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 script = ExtResource("1_yx80n") -metadata/_edit_vertical_guides_ = [540.0, 62.0, 1020.0] +metadata/_edit_vertical_guides_ = [540.0, 62.0, 1020.0, 490.0, 590.0] +metadata/_edit_horizontal_guides_ = [940.0, 1340.0] [node name="Background" type="ColorRect" parent="."] material = SubResource("ShaderMaterial_v5r1v") @@ -73,10 +74,10 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -479.5 -offset_top = -810.0 -offset_right = 479.5 -offset_bottom = -20.0 +offset_left = -480.0 +offset_top = -860.0 +offset_right = 479.0 +offset_bottom = -70.0 grow_horizontal = 2 grow_vertical = 2 @@ -101,10 +102,10 @@ size_flags_vertical = 4 layout_mode = 2 [node name="Button" parent="VBoxContainer/VSplitContainer/BottomCenterContainer/ToDoBtn" index="0"] -offset_left = -439.5 -offset_top = 97.0 -offset_right = -83.5 -offset_bottom = 388.0 +offset_left = -418.0 +offset_top = 50.0 +offset_right = -49.0 +offset_bottom = 404.0 text = "To-Do" [node name="CalendarBtn" parent="VBoxContainer/VSplitContainer/BottomCenterContainer" instance=ExtResource("4_71840")] @@ -114,10 +115,10 @@ layout_mode = 2 anchors_preset = 0 anchor_right = 0.0 anchor_bottom = 0.0 -offset_left = 79.0 -offset_top = 97.0 -offset_right = 434.0 -offset_bottom = 388.0 +offset_left = 51.0 +offset_top = 50.0 +offset_right = 420.0 +offset_bottom = 404.0 grow_horizontal = 1 grow_vertical = 1 text = "Calendar" @@ -126,20 +127,20 @@ text = "Calendar" layout_mode = 2 [node name="Button" parent="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn" index="0"] -offset_left = -439.5 -offset_top = 502.0 -offset_right = -83.5 -offset_bottom = 793.0 +offset_left = -418.0 +offset_top = 450.0 +offset_right = -49.0 +offset_bottom = 804.0 text = "Store" [node name="StoreBtn2" parent="VBoxContainer/VSplitContainer/BottomCenterContainer" instance=ExtResource("4_71840")] layout_mode = 2 [node name="Button" parent="VBoxContainer/VSplitContainer/BottomCenterContainer/StoreBtn2" index="0"] -offset_left = 79.5 -offset_top = 502.0 -offset_right = 435.5 -offset_bottom = 793.0 +offset_left = 51.0 +offset_top = 450.0 +offset_right = 420.0 +offset_bottom = 804.0 text = "Store" [node name="MenuButton" parent="." instance=ExtResource("5_qjr8j")] diff --git a/themes/default/Default_theme.tres b/themes/default/Default_theme.tres index 6c5e589..e05331c 100644 --- a/themes/default/Default_theme.tres +++ b/themes/default/Default_theme.tres @@ -2,32 +2,34 @@ [ext_resource type="FontFile" uid="uid://cek5417mq2pbt" path="res://themes/default/fonts/BunnyCute-Regular.otf" id="1_ab6ib"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l5yqt"] -bg_color = Color(0.286275, 0.647059, 0.8, 1) -border_width_bottom = 10 -border_color = Color(0.168627, 0.458824, 0.580392, 1) -corner_radius_top_left = 30 -corner_radius_top_right = 30 -corner_radius_bottom_right = 30 -corner_radius_bottom_left = 30 -anti_aliasing = false - [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bk2rt"] -bg_color = Color(0.286275, 0.647059, 0.8, 1) -border_width_bottom = 20 -border_color = Color(0.168627, 0.458824, 0.580392, 1) -corner_radius_top_left = 30 -corner_radius_top_right = 30 -corner_radius_bottom_right = 30 -corner_radius_bottom_left = 30 -anti_aliasing = false +bg_color = Color(0.545098, 0.815686, 0.827451, 1) +border_color = Color(1, 0.776471, 0.729412, 1) +corner_radius_top_left = 90 +corner_radius_top_right = 90 +corner_radius_bottom_right = 90 +corner_radius_bottom_left = 90 +shadow_color = Color(1, 0.776471, 0.729412, 1) +shadow_size = 6 +shadow_offset = Vector2(12, 12) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rqaqj"] +bg_color = Color(0.545098, 0.815686, 0.827451, 1) +border_color = Color(1, 0.776471, 0.729412, 1) +corner_radius_top_left = 90 +corner_radius_top_right = 90 +corner_radius_bottom_right = 90 +corner_radius_bottom_left = 90 +shadow_color = Color(1, 0.776471, 0.729412, 1) +shadow_size = 6 +shadow_offset = Vector2(4, 4) [resource] Button/font_sizes/font_size = 64 -Button/styles/disabled = SubResource("StyleBoxFlat_l5yqt") +Button/styles/disabled = SubResource("StyleBoxFlat_bk2rt") Button/styles/hover = SubResource("StyleBoxFlat_bk2rt") Button/styles/normal = SubResource("StyleBoxFlat_bk2rt") -Button/styles/pressed = SubResource("StyleBoxFlat_l5yqt") +Button/styles/pressed = SubResource("StyleBoxFlat_rqaqj") Fonts/fonts/large = ExtResource("1_ab6ib") Fonts/fonts/normal = ExtResource("1_ab6ib") Label/font_sizes/font_size = 64 -- 2.30.2