Inventory System — Now for sale in the Scirra Store!
https://www.scirra.com/store/royalty-free-game-templates/inventory-system-605
<p>Create containers and items. Items can act like containers, example: a bag. Containers can be customized any way you want, with whatever margin sizes. Item size can be adjusted. When creating containers, you can specify if resizable, movable, and more. Items can be created inside or outside containers, moved, etc. This system is suitable for any type of game that needs an inventory.</p><p>setupContainer(Container.UID,slotLimitX,slotLimitY,showXslots,slotYslots,pixelwidth,pixelheight,resizable,movable,visible)</p>
- Container.UID - The uid of the container that was created that this function will set up(Create a container object first, then use it's uid).
- slotLimitX - slots wide.
- slotLimitY - slots high.
- showXslots - slots wide to show.
- showYslots - slots high to show.
- pixelwidth - If showXslots equals 0, container's width will be set to this.
- pixelheight - If showYslots equals 0, container's height will be set to this.
- resizable - 0 for no resizing, 1 for resizing(click and drag edges of container).
- movable - 0 for unmovable, 1 for movable(click and drag container).
- visible - 0 for invisible, 1 for visible
<p>setupItem(animation,posx,posy,quantity,connected container uid(-2 none),in container uid, slotx,sloty)</p>
- animation - The animation within the Item sprite.
- posx - coordinate to place item if it isn't being placed into a container.
- posy - coordinate.
- quantity - the item quantity.
- connected container - the uid of the container that this item will open and close (use a value of -2 if there isn't one since -1 is used in the container data array).
- in container uid - If this item will be placed in a container then put the uid of container.
- slotx - the horizontal slot (1 for first column).
- sloty - the vertical slot (1 for first row).
<p>toggleContainer(Container.UID)</p><p>destroyItem(Items.UID)</p><p>destroyContainer(Container.UID)</p><p>addToContainer(Items.UID,Container.UID)</p><p>dropOutItem(Items.UID,posx,posy)</p>
Use this topic to leave comments, ask questions and talk about Inventory System