Get it on the Scirra Store: construct.net/en/game-assets/game-templates/advanced-inventory-1020
This is an advanced inventory example similar to Terraria. There are three items, circles, squares, and triangles, though you can easily add more. The inventory can hold one circle, 5 squares, or 10 triangles per slot. When you click an item, it will go to the next empty slot. You can move all items in one slot to another by left clicking or move just one by right clicking the item you want to move. Fully commented. Editable with free edition.