Hotbar

Inherits: NodeInventories < Node

Node representing the player’s hotbar related to an Inventory.

Properties

NodePath

inventory

NodePath("")

int

max_slots

4

int

selection_index

-1

Methods

void

active_slot(slot_index: int)

void

deactive_slot(slot_index: int)

void

equip(stack: ItemStack, slot_index: int)

Inventory

get_inventory() const

ItemStack

get_stack_on_selection() const

ItemStack

get_stack_on_slot(slot_index: int) const

bool

has_valid_stack_on_selection() const

bool

has_valid_stack_on_slot(slot_index: int) const

bool

is_active_slot(slot_index: int) const

void

next_item()

void

previous_item()

void

unequip(slot_index: int)


Signals

equipped(slot_index: int) 🔗

There is currently no description for this signal. Please help us by contributing one!


equipped_stack_changed(slot_index: int) 🔗

There is currently no description for this signal. Please help us by contributing one!


on_change_selection(selection_index: int) 🔗

Emitted when selection_index changes.


unequipped(slot_index: int) 🔗

There is currently no description for this signal. Please help us by contributing one!


Property Descriptions

NodePath inventory = NodePath("") 🔗

  • void set_inventory_path(value: NodePath)

  • NodePath get_inventory_path()

Inventory related to hotbar.


int max_slots = 4 🔗

  • void set_max_slots(value: int)

  • int get_max_slots()

There is currently no description for this property. Please help us by contributing one!


int selection_index = -1 🔗

  • void set_selection_index(value: int)

  • int get_selection_index()

Current selection within the hotbar.


Method Descriptions

void active_slot(slot_index: int) 🔗

There is currently no description for this method. Please help us by contributing one!


void deactive_slot(slot_index: int) 🔗

There is currently no description for this method. Please help us by contributing one!


void equip(stack: ItemStack, slot_index: int) 🔗

There is currently no description for this method. Please help us by contributing one!


Inventory get_inventory() const 🔗

Returns the Inventory that is related to this hotbar.


ItemStack get_stack_on_selection() const 🔗

There is currently no description for this method. Please help us by contributing one!


ItemStack get_stack_on_slot(slot_index: int) const 🔗

There is currently no description for this method. Please help us by contributing one!


bool has_valid_stack_on_selection() const 🔗

There is currently no description for this method. Please help us by contributing one!


bool has_valid_stack_on_slot(slot_index: int) const 🔗

There is currently no description for this method. Please help us by contributing one!


bool is_active_slot(slot_index: int) const 🔗

Returns true if a valid ItemStack is in the current selection.


void next_item() 🔗

Switches from the current selection_index to the next selection.


void previous_item() 🔗

Switches from the current selection_index to the previous selection.


void unequip(slot_index: int) 🔗

There is currently no description for this method. Please help us by contributing one!