fix: Actionbar Icons füllen ganzen Slot + Slot-Nummern oben links
- Icon auf PRESET_FULL_RECT gesetzt statt 40x40 bei Position (5,5) - Slot-Nummern (1-9) als Label über dem Icon mit Schatten für Lesbarkeit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ccf2835cef
commit
923969593d
1 changed files with 17 additions and 3 deletions
20
hud.gd
20
hud.gd
|
|
@ -51,16 +51,30 @@ func _ready():
|
|||
_create_level_ui()
|
||||
|
||||
for i in range(9):
|
||||
# Icon erstellen
|
||||
# Icon erstellen — füllt den ganzen Slot
|
||||
var icon = TextureRect.new()
|
||||
icon.name = "Icon"
|
||||
icon.expand_mode = TextureRect.EXPAND_FIT_WIDTH_PROPORTIONAL
|
||||
icon.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||
icon.custom_minimum_size = Vector2(40, 40)
|
||||
icon.position = Vector2(5, 5)
|
||||
icon.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
icon.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
action_slots[i].add_child(icon)
|
||||
slot_icons.append(icon)
|
||||
|
||||
# Slot-Nummer (oben links, über dem Icon)
|
||||
var slot_number = Label.new()
|
||||
slot_number.name = "SlotNumber"
|
||||
slot_number.text = str(i + 1)
|
||||
slot_number.position = Vector2(2, 0)
|
||||
slot_number.size = Vector2(20, 16)
|
||||
slot_number.add_theme_font_size_override("font_size", 11)
|
||||
slot_number.add_theme_color_override("font_color", Color(1, 1, 1, 0.9))
|
||||
slot_number.add_theme_color_override("font_shadow_color", Color(0, 0, 0, 1))
|
||||
slot_number.add_theme_constant_override("shadow_offset_x", 1)
|
||||
slot_number.add_theme_constant_override("shadow_offset_y", 1)
|
||||
slot_number.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
action_slots[i].add_child(slot_number)
|
||||
|
||||
# Cooldown-Overlay erstellen (dunkle Überlagerung)
|
||||
var cooldown_overlay = ColorRect.new()
|
||||
cooldown_overlay.name = "CooldownOverlay"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue