feat: Implement core game scene with UI, managers, and a default mesh library.
This commit is contained in:
@@ -15,7 +15,7 @@ func _ready():
|
||||
print("[PowerUpUI] _ready called")
|
||||
# Map Effect Enum to UI Nodes (Assumes specific names in main.tscn)
|
||||
# We try to get them immediately. If they are children, they should be accessible.
|
||||
var container = get_node_or_null("HBoxContainer")
|
||||
var container = get_node_or_null("Container")
|
||||
if not container:
|
||||
print("[PowerUpUI] ERROR: HBoxContainer not found in ", get_path())
|
||||
return
|
||||
@@ -79,14 +79,28 @@ func _setup_btn(effect_id: int, btn: Button):
|
||||
var sc_lbl = Label.new()
|
||||
sc_lbl.name = "ShortcutLabel"
|
||||
sc_lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
sc_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
sc_lbl.vertical_alignment = VERTICAL_ALIGNMENT_BOTTOM
|
||||
sc_lbl.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
# Offset slightly below or at bottom edge
|
||||
sc_lbl.offset_bottom = 20
|
||||
sc_lbl.add_theme_font_size_override("font_size", 14)
|
||||
|
||||
# Position: Left of the button
|
||||
sc_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||
sc_lbl.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
sc_lbl.add_theme_font_size_override("font_size", 16)
|
||||
sc_lbl.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
sc_lbl.add_theme_constant_override("outline_size", 4)
|
||||
# Add color override to make it distinct (optional, but good for visibility)
|
||||
sc_lbl.add_theme_color_override("font_color", Color(0.9, 0.9, 0.9))
|
||||
|
||||
# Determine Label Text based on Effect ID
|
||||
# 0: Speed -> 1
|
||||
|
||||
Reference in New Issue
Block a user