Skip to content

Hotbar

ModularHotbar provides a quick-access horizontal bar for items, typically displayed at the bottom center of the screen. It displays a specific "window" of the player's main inventory.

Setup

  1. Add a ModularHotbar node to your UI.
  2. Assign an HBoxContainer to the slots_container property.
  3. Link it to an InventoryComponent via the source_component property.
  4. Configure the window:
  5. hotbar_size: How many slots to display (e.g., 9).
  6. start_index: starting index in the main inventory (e.g., 0 for slots 0-8).

Scroll Navigation

Players can cycle through hotbar slots using the mouse wheel. - enable_scroll_navigation: Toggles mouse wheel support. - scroll_wraps: If true, scrolling past the last slot loops back to the first.

Signals

Signal Description
selection_changed(new_index: int) Emitted when the player scrolls or clicks a new slot.

Input Handling

  • Left Click: Selects the slot.
  • Right Click: Starts a drag operation picking up exactly 1 item.
  • Shift + Left Click: Instantly transfers the entire stack to another open inventory (Quick Move).
  • Scroll Wheel: Changes the selected_index and emits selection_changed.