Inventory system
Let's now use some Blueprint Widget to create the user interface and the inventory system. We will need three classes: a main GameUI
, Inventory Button
, and Inventory Craft Button
.
The main GameUI is what the player will see. It will contain a grid of objects (the actual inventory), a panel that shows the information of the selected item, and a cookbook that contains all the items that are available to be crafted.
The Inventory Button is the single button of our inventory and will be just a single squared button with an image over it.
The Inventory Craft Button is similar to the other button, but it also contains the name of the item that will be crafted and the items needed to the player to craft it.
The inventory button
Create a Blueprint Widget and call it InventoryButton
. This object (and all the Widget that will be added into Canvas Panel dynamically) doesn't need a main canvas. The aspect (size, anchor, position, and so on) will be determined directly within the panel where...