Inventory System (Templates)

Discuss Scirra's 2D Asset Store

Post » Wed Jan 21, 2015 4:05 pm



Inventory System — Now for sale in the Scirra Store!
https://www.scirra.com/store/royalty-free-game-templates/inventory-system-605

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.

setupContainer(Container.UID,slotLimitX,slotLimitY,showXslots,slotYslots,pixelwidth,pixelheight,resizable,movable,visible)

  • 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

setupItem(animation,posx,posy,quantity,connected container uid(-2 none),in container uid, slotx,sloty)

  • 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).

toggleContainer(Container.UID)

destroyItem(Items.UID)

destroyContainer(Container.UID)

addToContainer(Items.UID,Container.UID)

dropOutItem(Items.UID,posx,posy)



Use this topic to leave comments, ask questions and talk about Inventory System
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Wed Jan 21, 2015 7:10 pm

Here's a quick gif showing it in action.
Image
You can have as many different container styles as you want.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Wed Jan 21, 2015 7:14 pm

Looks quite impressive, well done!
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Wed Jan 21, 2015 9:45 pm

@Somebody , thanks!
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Thu Jan 22, 2015 7:31 am

Looks fabulous! Really like it!:-)
Image
Check out our start-up and configure your own helmet in true 3D.
B
43
S
11
G
11
Posts: 1,154
Reputation: 9,948

Post » Tue May 26, 2015 8:41 pm

@Prominent
1.are you planning to add slider to containers?
2.any plans about sale?
ImageImage
B
78
S
25
G
7
Posts: 190
Reputation: 10,256

Post » Thu May 28, 2015 8:27 am

Good work, Nicely Presented as well.
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Sun Jun 07, 2015 12:30 am

@SirG , it has been a while since I have looked at the events. Sliders could be added, but at the moment I don't have plans to implement it since I am busy with other projects. As to sale, I'll consider it. I haven't been active around here in months, so I'd need to look at what is selling, etc.
@Madrasmadnes , Thanks!
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842


Return to Scirra Store

Who is online

Users browsing this forum: BackendFreak and 1 guest