> For the complete documentation index, see [llms.txt](https://cowsinss-organization.gitbook.io/inventory-pro-add-on-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cowsinss-organization.gitbook.io/inventory-pro-add-on-documentation/content/03.-content/03.4-inventory/inventoryslot.md).

# InventorySlot

When using the Inventory or Chests in FPS Engine, Players will interact with InventorySlots. InventorySlot contains information about items, quantities & handles&#x20;interactions between the InventoryProManager and the Player.

***

* <mark style="color:purple;">iconImage:</mark> Image that dipslays the Icon of the Item held by this InventorySlot
* <mark style="color:purple;">amountText:</mark> Text that shows the current amount or quantity stored in the slot data of this inventory slot.
* <mark style="color:purple;">backgroundImage:</mark> Background of the Slot. This is coloured to indicate if the Slot is Available or occupied when hovered while dragging an object.

#### Inventory Slot Interactions

* <mark style="color:purple;">highlightedScale:</mark> Inventory Slot object Scale when hovered/highlighted
* <mark style="color:purple;">highlightedBorder:</mark> GameObject that gets enabled when the InventorySlot is highlighted. This particularly simulates a border.
* <mark style="color:purple;">lerpSpeed:</mark> Speed to lerp from the default scale to the highlightedScale
* <mark style="color:purple;">iconImageMargins:</mark> Adjusts Icon Image Spacing to properly fit the Icons in the Slot
* <mark style="color:purple;">inventoryContainer:</mark> Object that contains the entire Inventory Slot

***

### Functions | InventorySlot.cs&#x20;

> <mark style="color:green;">UpdateSlotGraphics()</mark>
>
> Updates a specific InventorySlot visuals. Displays the Icon of the stored Item in SlotData, and displays the amount ( If Item is not null ).> \
> In case Item is null, it will reset the graphics to the default/blank state.

> <mark style="color:green;">ClearSlot()</mark>
>
> Resets the Slot Data of an Ivnentory Slot & Updates its Visuals

> <mark style="color:green;">GahterSprite()</mark>
>
> Returns proper Item Sprite based on sizing and availability.

> <mark style="color:green;">GatherName()</mark>
>
> Returns proper Item Name based on availability.

> <mark style="color:green;">GatherDescription()</mark>
>
> Returns proper Item Description based on availability.

> <mark style="color:green;">GetAnchorSlot()</mark>
>
> Returns current Anchor Slot. If Anchor Slot is null, it will return itself, as it cannot be anchored to anything else.

> <mark style="color:green;">IsHotbarSlot()</mark>
>
> Returns true if this is a hotbar slot.

> <mark style="color:green;">IsInventorySlot()</mark>
>
> Returns true if this is an Inventory slot.

> <mark style="color:green;">IsChestSlot()</mark>
>
> Returns true if this is a Chest slot.

> <mark style="color:green;">GatherSlotType()</mark>
>
> Returns Slot Type directly.

> <mark style="color:green;">HasValidItem()</mark>
>
> Returns true if SlotData of this InventorySlot contains a valid Item.

> <mark style="color:green;">IsItemWeapon()</mark>
>
> Returns true if the Item in Slot Data is a Weapon\_SO

> <mark style="color:green;">IsItemAttachment()</mark>
>
> Returns true if the Item in Slot Data is a AttachmentIdentifier\_SO

> <mark style="color:green;">IsItemBullets()</mark>
>
> Returns true if the Item in Slot Data is a BulletsItem\_SO

> <mark style="color:green;">GetItemSize()</mark>
>
> Returns the Item Size of the Item in SlotData.
>
> If Item is null, a default 1x1 size will be returned.

> <mark style="color:green;">Select()</mark>
>
> Highlights this Inventory Slot and represents it visually. Often used by Gamepad / Controller.

> <mark style="color:green;">Unselect()</mark>
>
> Unselects this slot and represents it visually. Often used by Gamepad / Controller.
