feat: add powerup inventory UI for managing player powerups and a mobile touch controls manager with a virtual joystick and configurable action buttons.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user