diff --git a/hud.gd b/hud.gd index f0b0ac4..2b045b7 100644 --- a/hud.gd +++ b/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"