From a29f1639f2957f8c4fb84771d233e5cf6e8588dc Mon Sep 17 00:00:00 2001 From: Yogi Wiguna Date: Thu, 26 Feb 2026 11:56:16 +0800 Subject: [PATCH] feat: add powerup inventory UI for managing player powerups and a mobile touch controls manager with a virtual joystick and configurable action buttons. --- scripts/managers/touch_controls.gd | 4 ++++ scripts/ui/powerup_inventory_ui.gd | 21 ++++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/managers/touch_controls.gd b/scripts/managers/touch_controls.gd index 2066d50..01399f4 100644 --- a/scripts/managers/touch_controls.gd +++ b/scripts/managers/touch_controls.gd @@ -267,6 +267,10 @@ func _ensure_shortcut_label(btn: Button, button_name: String): existing_lbl.vertical_alignment = VERTICAL_ALIGNMENT_TOP existing_lbl.offset_top = -5 # Closer to top existing_lbl.offset_right = 0 # Aligned with right edge + + # Ensure Outline + existing_lbl.add_theme_color_override("font_outline_color", Color.BLACK) + existing_lbl.add_theme_constant_override("outline_size", 4) return # Add Keyboard Shortcut Label diff --git a/scripts/ui/powerup_inventory_ui.gd b/scripts/ui/powerup_inventory_ui.gd index e2e6d5d..c71dc16 100644 --- a/scripts/ui/powerup_inventory_ui.gd +++ b/scripts/ui/powerup_inventory_ui.gd @@ -85,21 +85,16 @@ func _setup_btn(effect_id: int, btn: Button): sc_lbl.name = "ShortcutLabel" sc_lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE - # Position: Left of the button - sc_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT - sc_lbl.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + # Position: Top Left of the button + sc_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT + sc_lbl.vertical_alignment = VERTICAL_ALIGNMENT_TOP - # Anchor to left middle - sc_lbl.anchor_left = 0.0 - sc_lbl.anchor_top = 0.5 - sc_lbl.anchor_right = 0.0 - sc_lbl.anchor_bottom = 0.5 + # Anchor to top left + sc_lbl.set_anchors_preset(Control.PRESET_TOP_LEFT) - # Offset to the left (negative x) - sc_lbl.offset_left = -40 - sc_lbl.offset_right = -4 # Small padding - sc_lbl.offset_top = -10 - sc_lbl.offset_bottom = 10 + # Offset to be close to the corner + sc_lbl.offset_left = 0 + sc_lbl.offset_top = -5 # Close to the button top sc_lbl.add_theme_font_size_override("font_size", 16) sc_lbl.add_theme_color_override("font_outline_color", Color.BLACK)