summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-11-22 09:56:30 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-11-22 09:56:47 +0200
commit5c726e339a56113878073aa1929d007d052c8a8b (patch)
treec3bf876a2042f401db61c61e7cc2e6a09b7cb60a
parentba7899742388e6cf33bcb85c42b9cd0855c4896a (diff)
Fix touchscreen button highlight bug
-rw-r--r--docs/index.html2
-rw-r--r--docs/index.pckbin2037696 -> 2037744 bytes
-rw-r--r--docs/index.service.worker.js2
-rw-r--r--touch_screen_button.gd8
-rw-r--r--touch_screen_button.tscn7
-rw-r--r--touch_screen_ui.tscn8
6 files changed, 15 insertions, 12 deletions
diff --git a/docs/index.html b/docs/index.html
index b1b6549..6ec32c9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -112,7 +112,7 @@ body {
<script src="index.js"></script>
<script>
-const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":2037696,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4,"serviceWorker":"index.service.worker.js"};
+const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":2037744,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4,"serviceWorker":"index.service.worker.js"};
const GODOT_THREADS_ENABLED = false;
const engine = new Engine(GODOT_CONFIG);
diff --git a/docs/index.pck b/docs/index.pck
index 59189f7..ea6ccf7 100644
--- a/docs/index.pck
+++ b/docs/index.pck
Binary files differ
diff --git a/docs/index.service.worker.js b/docs/index.service.worker.js
index e2f7608..bd7e6e9 100644
--- a/docs/index.service.worker.js
+++ b/docs/index.service.worker.js
@@ -4,7 +4,7 @@
// Incrementing CACHE_VERSION will kick off the install event and force
// previously cached resources to be updated from the network.
/** @type {string} */
-const CACHE_VERSION = '1763759691|18290620371';
+const CACHE_VERSION = '1763798201|23815754536';
/** @type {string} */
const CACHE_PREFIX = 'MobileMetroidvan-sw-cache-';
const CACHE_NAME = CACHE_PREFIX + CACHE_VERSION;
diff --git a/touch_screen_button.gd b/touch_screen_button.gd
index b607964..d45098a 100644
--- a/touch_screen_button.gd
+++ b/touch_screen_button.gd
@@ -5,11 +5,13 @@ extends TouchScreenButton
@export var active_color: Color
func _ready() -> void:
+ connect("pressed", _on_pressed)
+ connect("released", _on_released)
$TextureRect.texture = texture
- $TextureRect/CanvasModulate.color = inactive_color
+ $TextureRect.modulate = inactive_color
func _on_pressed() -> void:
- $TextureRect/CanvasModulate.color = active_color
+ $TextureRect.modulate = active_color
func _on_released() -> void:
- $TextureRect/CanvasModulate.color = inactive_color
+ $TextureRect.modulate = inactive_color
diff --git a/touch_screen_button.tscn b/touch_screen_button.tscn
index e1d0898..355d491 100644
--- a/touch_screen_button.tscn
+++ b/touch_screen_button.tscn
@@ -10,8 +10,6 @@ shape = SubResource("RectangleShape2D_l8v81")
passby_press = true
visibility_mode = 1
script = ExtResource("1_8gxd0")
-inactive_color = Color(0.54509807, 0.6666667, 1, 0.5019608)
-active_color = Color(0, 0.77254903, 0.7764706, 0.5019608)
[node name="TextureRect" type="TextureRect" parent="."]
offset_left = -8.0
@@ -19,8 +17,3 @@ offset_top = -8.0
offset_right = 8.0
offset_bottom = 8.0
expand_mode = 1
-
-[node name="CanvasModulate" type="CanvasModulate" parent="TextureRect"]
-
-[connection signal="pressed" from="." to="." method="_on_pressed"]
-[connection signal="released" from="." to="." method="_on_released"]
diff --git a/touch_screen_ui.tscn b/touch_screen_ui.tscn
index a9b29b3..52e4e37 100644
--- a/touch_screen_ui.tscn
+++ b/touch_screen_ui.tscn
@@ -15,19 +15,27 @@ size = Vector2(40, 26)
position = Vector2(60, 88)
action = "move_right"
texture = ExtResource("2_e48dh")
+inactive_color = Color(0.54509807, 0.6666667, 1, 0.5019608)
+active_color = Color(0, 0.77254903, 0.7764706, 0.5019608)
[node name="TouchScreenButtonLeft" parent="." groups=["ui_movement"] instance=ExtResource("1_e48dh")]
position = Vector2(20, 88)
action = "move_left"
texture = ExtResource("3_e48dh")
+inactive_color = Color(0.54509807, 0.6666667, 1, 0.5019608)
+active_color = Color(0, 0.77254903, 0.7764706, 0.5019608)
[node name="TouchScreenButtonJump" parent="." groups=["ui_movement"] instance=ExtResource("1_e48dh")]
position = Vector2(172, 88)
action = "jump"
texture = ExtResource("4_e48dh")
+inactive_color = Color(0.54509807, 0.6666667, 1, 0.5019608)
+active_color = Color(0, 0.77254903, 0.7764706, 0.5019608)
[node name="TouchScreenButtonMenu" parent="." groups=["ui_menu"] instance=ExtResource("1_e48dh")]
position = Vector2(172, 13)
shape = SubResource("RectangleShape2D_k6i1l")
action = "menu"
texture = ExtResource("5_e48dh")
+inactive_color = Color(0.54509807, 0.6666667, 1, 0.5019608)
+active_color = Color(0, 0.77254903, 0.7764706, 0.5019608)