Inherits: Control
A UI control similar to CtrlInventoryGrid
but with extended options for customization.
field_dimensions: Vector2
- The size of each inventory field in pixels.item_spacing: int
- The spacing between items in pixels.inventory_path: NodePath
- Path to anInventory
node.default_item_texture: Texture
- The default texture that will be used for items with noimage
property.stretch_item_sprites: bool
- If true, the inventory item sprites will be stretched to fit the inventory fields they are positioned on.inventory: InventoryGrid
- TheInventory
node linked to this control.select_mode: int
- Single or multi select mode (hold CTRL to select multiple items).field_style: StyleBox
- Style of a single inventory field.field_highlighted_style: StyleBox
- Style of a single inventory field when the mouse hovers over it.field_selected_style: StyleBox
- Style of a single inventory field when the item on top of it is selected.selection_style: StyleBox
- Style of a rectangle that will be drawn on top of the selected item.
get_selected_inventory_item() -> InventoryItem
- Returns the currently selected item. In case multiple items are selected, the first one is returned.get_selected_inventory_items() -> Array[InventoryItem]
- Returns all the currently selected items.select_inventory_item(item: InventoryItem) -> void
- Selects the given item.deselect_inventory_item() -> void
- Deselects the selected item.
item_dropped(InventoryItem, Vector2)
- Emitted when a grabbedInventoryItem
is dropped.inventory_item_activated(InventoryItem)
- Emitted when anInventoryItem
is activated (i.e. double clicked).inventory_item_context_activated(InventoryItem)
- Emitted when the context menu of anInventoryItem
is activated (i.e. right clicked).selection_changed
- Emitted when the selection has changed. Useget_selected_inventory_item()
to obtain the currently selected item.item_mouse_entered(InventoryItem)
- Emitted when the mouse enters theRect
area of the control representing the givenInventoryItem
.item_mouse_exited(InventoryItem)
- Emitted when the mouse leaves theRect
area of the control representing the givenInventoryItem
.