Items
About this demo
The demo signs in automatically with an anonymous account. The account is shared across every demo in the showroom, so items and currency you get in one demo carry over to the others. Loading takes a moment. If the frame is too small, open the demo in a new tab.
Overview
The page lists how many of three items (potion, ether, elixir) you hold and lets you gain or spend each one at a time. It shows that each item is counted separately, and that the spend button is disabled for an item you have none of.
How to try it
- Your items lists three items, and Stock shows each name and count, e.g. potion x0. Every item starts at 0.
- For an item you have none of, Spend is disabled.
- Press Gain on any item; only that item’s count goes up by 1, and its Spend becomes available.
- Press Spend to use one; the count goes down by 1. Back at 0, Spend is disabled again.
GS2 services used
- GS2-Inventory: A GS2-Inventory simple inventory defines the three items
potion,ether, andelixir, and holds each player’s count of each. - GS2-Exchange: GS2-Exchange rates define, per item, the transaction behind Gain (acquire one) and Spend (consume one), executed server-side automatically.
Use it in GS2 Studio
In GS2 Studio’s Simple mode, open Add features and press Add on Items to bring this feature into your own project. To point at the package directly, choose Add from GitHub and enter the package below.
https://github.com/gs2io/gs2-studio-package/tree/main/foundation-economy-inventory/packages/foundation-economy-inventory- Owner:
gs2io - Repository:
gs2-studio-package - Subdirectory:
foundation-economy-inventory/packages/foundation-economy-inventory