Skip to main content

Item

Properties

Position

Item.Position: Vector2

The position of the Item in a grid ItemManager.

PositionChanged

This item is read only and cannot be modified. Read OnlySignal
Item.PositionChanged: RBXScriptSignal

An event signal that fires every time the Item has it's position changed.

Size

Item.Size: Vector2

The size of the Item in a grid ItemManager.

Rotation

This item is read only and cannot be modified. Read Only
Item.Rotation: number

The current rotation of the item. Use Item:Rotate() to edit.

PotentialRotation

This item is read only and cannot be modified. Read Only
Item.PotentialRotation: number

The rotation that will be applied if a successful move goes through.

ItemManager

This item is read only and cannot be modified. Read Only
Item.ItemManager: ItemManagerObject?

The current ItemManger that the Item is in.

ItemManagerChanged

This item is read only and cannot be modified. Read OnlySignal
Item.ItemManagerChanged: RBXScriptSignal

An event signal that fires every time the Item is moved in a new ItemManager.

HoveringItemManager

This item is read only and cannot be modified. Read Only
Item.HoveringItemManager: ItemManagerObject?

The ItemManager that the Item is hovering over. ItemManagers need to be linked via TranferLinks to register as a hoverable ItemManager.

HoveringItemManagerChanged

This item is read only and cannot be modified. Read OnlySignal
Item.HoveringItemManagerChanged: RBXScriptSignal

An event signal that fires every time the Item is hovering over a new ItemManager.

MoveMiddleware

Item.MoveMiddleware: ((
movedItemItem,
newGridPositionVector2,
lastItemManagerItemManager,
newItemManagerItemManager
) → boolean)?

A callback function where you can do additional move checks. The Item will be automatically moved back if the callback function returns false.

Functions

new

Item.new(propertiesTypes.ItemProperties) → Types.ItemObject

Creates a new Item object.

Rotate

Item:Rotate(quartersOf360number) → ()

Rotates the Item, has to be dragged to be rotatable.

SetItemManager

Item:SetItemManager(itemManagerTypes.ItemManagerObject) → ()

Moves an item to a new ItemManager. This should only be used for transferring Items between ItemManagers that aren't linked using TranferLinks.

Destroy

Item:Destroy() → ()

Destroy the Item object.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new Item object.",
            "params": [
                {
                    "name": "properties",
                    "desc": "",
                    "lua_type": "Types.ItemProperties"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Types.ItemObject\r\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 99,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "_createDefaultItemAsset",
            "desc": "Used to create the default Item GUI asset if the user hasn't specified one.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CanvasGroup\r\n"
                }
            ],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 308,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "_generateItemElement",
            "desc": "Clones the specified Item GUI asset in the `Item.Assets.Item` property.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 352,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "_updateDraggingPosition",
            "desc": "Updates the Item's GUI element position to align with the mouse position.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 367,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "_updateItemToItemManagerDimentions",
            "desc": "Updates the Item's GUI element size and position to align with the new ItemManager.",
            "params": [
                {
                    "name": "applyPosition",
                    "desc": "",
                    "lua_type": "boolean?"
                },
                {
                    "name": "applySize",
                    "desc": "",
                    "lua_type": "boolean?"
                },
                {
                    "name": "usePositionTween",
                    "desc": "",
                    "lua_type": "boolean?"
                },
                {
                    "name": "useSizeTween",
                    "desc": "",
                    "lua_type": "boolean?"
                },
                {
                    "name": "itemManager",
                    "desc": "",
                    "lua_type": "Types.ItemManagerObject?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 389,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "Rotate",
            "desc": "Rotates the Item, has to be dragged to be rotatable.",
            "params": [
                {
                    "name": "quartersOf360",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 425,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "SetItemManager",
            "desc": "Moves an item to a new ItemManager. This should only be used for transferring Items between ItemManagers that aren't linked using TranferLinks.",
            "params": [
                {
                    "name": "itemManager",
                    "desc": "",
                    "lua_type": "Types.ItemManagerObject"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 457,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Destroy the Item object.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 474,
                "path": "src/Item.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Position",
            "desc": "The position of the Item in a grid ItemManager.",
            "lua_type": "Vector2",
            "source": {
                "line": 29,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "PositionChanged",
            "desc": "An event signal that fires every time the Item has it's position changed.",
            "lua_type": "RBXScriptSignal",
            "tags": [
                "Signal"
            ],
            "readonly": true,
            "source": {
                "line": 37,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "Size",
            "desc": "The size of the Item in a grid ItemManager.",
            "lua_type": "Vector2",
            "source": {
                "line": 43,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "Rotation",
            "desc": "The current rotation of the item. Use `Item:Rotate()` to edit.",
            "lua_type": "number",
            "readonly": true,
            "source": {
                "line": 50,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "PotentialRotation",
            "desc": "The rotation that will be applied if a successful move goes through.",
            "lua_type": "number",
            "readonly": true,
            "source": {
                "line": 57,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "ItemManager",
            "desc": "The current ItemManger that the Item is in.",
            "lua_type": "ItemManagerObject?",
            "readonly": true,
            "source": {
                "line": 64,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "ItemManagerChanged",
            "desc": "An event signal that fires every time the Item is moved in a new ItemManager.",
            "lua_type": "RBXScriptSignal",
            "tags": [
                "Signal"
            ],
            "readonly": true,
            "source": {
                "line": 72,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "HoveringItemManager",
            "desc": "The ItemManager that the Item is hovering over. ItemManagers need to be linked via TranferLinks to register as a hoverable ItemManager.",
            "lua_type": "ItemManagerObject?",
            "readonly": true,
            "source": {
                "line": 79,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "HoveringItemManagerChanged",
            "desc": "An event signal that fires every time the Item is hovering over a new ItemManager.",
            "lua_type": "RBXScriptSignal",
            "tags": [
                "Signal"
            ],
            "readonly": true,
            "source": {
                "line": 87,
                "path": "src/Item.lua"
            }
        },
        {
            "name": "MoveMiddleware",
            "desc": "A callback function where you can do additional move checks. The Item will be automatically moved back if the callback function returns false.",
            "lua_type": "((movedItem: Item, newGridPosition: Vector2, lastItemManager: ItemManager, newItemManager: ItemManager) -> boolean)?",
            "source": {
                "line": 93,
                "path": "src/Item.lua"
            }
        }
    ],
    "types": [],
    "name": "Item",
    "desc": "",
    "source": {
        "line": 23,
        "path": "src/Item.lua"
    }
}