moved buttons
authorEduardo <[email protected]>
Tue, 26 Sep 2023 20:28:53 +0000 (22:28 +0200)
committerEduardo <[email protected]>
Tue, 26 Sep 2023 20:28:53 +0000 (22:28 +0200)
buttons/AnimatedButton.gd [deleted file]
buttons/AnimatedButton.tscn [deleted file]
custom_elements/buttons/AnimatedButton.gd [new file with mode: 0644]
custom_elements/buttons/AnimatedButton.tscn [new file with mode: 0644]
scenes/main_menu/MainMenu.tscn

diff --git a/buttons/AnimatedButton.gd b/buttons/AnimatedButton.gd
deleted file mode 100644 (file)
index 345679f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-extends Control
-
-@onready var button = $Button
-
-func _on_button_button_down():
-       animate_button_down()
-
-func _on_button_button_up():
-       animate_button_up()
-
-func animate_button_down():
-       var new_position = Vector2(button.position.x + 8, button.position.y + 8)
-       animate_button(new_position)
-
-func animate_button_up():
-       var new_position = Vector2(button.position.x - 8, button.position.y - 8)
-       animate_button(new_position)
-
-func animate_button(b_position: Vector2):
-       var tween = get_tree().create_tween().set_parallel(true)
-       tween.tween_property(button, "position", b_position, 0.05)
diff --git a/buttons/AnimatedButton.tscn b/buttons/AnimatedButton.tscn
deleted file mode 100644 (file)
index f4c79be..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-[gd_scene load_steps=2 format=3 uid="uid://wcc3vm8lhbp6"]
-
-[ext_resource type="Script" path="res://buttons/AnimatedButton.gd" id="1_kw4tk"]
-
-[node name="AnimatedButton" type="Control"]
-layout_mode = 3
-anchor_right = 1.0
-anchor_bottom = 0.078
-offset_bottom = 0.23999
-grow_horizontal = 2
-script = ExtResource("1_kw4tk")
-
-[node name="Button" type="Button" parent="."]
-layout_mode = 1
-anchors_preset = 15
-anchor_right = 1.0
-anchor_bottom = 1.0
-grow_horizontal = 2
-grow_vertical = 2
-keep_pressed_outside = true
-text = "Button"
-
-[connection signal="button_down" from="Button" to="." method="_on_button_button_down"]
-[connection signal="button_up" from="Button" to="." method="_on_button_button_up"]
diff --git a/custom_elements/buttons/AnimatedButton.gd b/custom_elements/buttons/AnimatedButton.gd
new file mode 100644 (file)
index 0000000..345679f
--- /dev/null
@@ -0,0 +1,21 @@
+extends Control
+
+@onready var button = $Button
+
+func _on_button_button_down():
+       animate_button_down()
+
+func _on_button_button_up():
+       animate_button_up()
+
+func animate_button_down():
+       var new_position = Vector2(button.position.x + 8, button.position.y + 8)
+       animate_button(new_position)
+
+func animate_button_up():
+       var new_position = Vector2(button.position.x - 8, button.position.y - 8)
+       animate_button(new_position)
+
+func animate_button(b_position: Vector2):
+       var tween = get_tree().create_tween().set_parallel(true)
+       tween.tween_property(button, "position", b_position, 0.05)
diff --git a/custom_elements/buttons/AnimatedButton.tscn b/custom_elements/buttons/AnimatedButton.tscn
new file mode 100644 (file)
index 0000000..373b419
--- /dev/null
@@ -0,0 +1,24 @@
+[gd_scene load_steps=2 format=3 uid="uid://wcc3vm8lhbp6"]
+
+[ext_resource type="Script" path="res://custom_elements/buttons/AnimatedButton.gd" id="1_kw4tk"]
+
+[node name="AnimatedButton" type="Control"]
+layout_mode = 3
+anchor_right = 1.0
+anchor_bottom = 0.078
+offset_bottom = 0.23999
+grow_horizontal = 2
+script = ExtResource("1_kw4tk")
+
+[node name="Button" type="Button" parent="."]
+layout_mode = 1
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+keep_pressed_outside = true
+text = "Button"
+
+[connection signal="button_down" from="Button" to="." method="_on_button_button_down"]
+[connection signal="button_up" from="Button" to="." method="_on_button_button_up"]
index 42b73c0b0e0e70976f44394f76caa26ce81e2a4a..4774d2aa17675515a14a7b8d44ddd6bf6bcaf2dc 100644 (file)
@@ -3,7 +3,7 @@
 [ext_resource type="Script" path="res://scenes/main_menu/MainMenu.gd" id="1_yx80n"]
 [ext_resource type="Texture2D" uid="uid://c3q0pfh7e8xj0" path="res://themes/default/back_pain_logo_text.png" id="2_6x8ou"]
 [ext_resource type="Texture2D" uid="uid://bjwbk76qmspia" path="res://themes/default/main_bunny.jpg" id="3_vaxsw"]
-[ext_resource type="PackedScene" uid="uid://wcc3vm8lhbp6" path="res://buttons/AnimatedButton.tscn" id="4_71840"]
+[ext_resource type="PackedScene" uid="uid://wcc3vm8lhbp6" path="res://custom_elements/buttons/AnimatedButton.tscn" id="4_71840"]
 [ext_resource type="PackedScene" uid="uid://b3077obpgfwkx" path="res://themes/default/buttons/menu_button/MenuButton.tscn" id="5_qjr8j"]
 [ext_resource type="Shader" path="res://themes/default/backgrounds/home_screen_dots.gdshader" id="6_xkkpt"]