Futurepass In-Game Inventory Example
Last updated
Last updated
As well as having access to the inventory in the overlay, you can build an in-game NFT inventory using Emergence's access to the Futurepass inventory service. This allows you to get all of the Futureverse NFTs owned by a wallet. Press the button to try it out!
Note: this example will only make sense if you have Futureverse NFTs in your wallet!
This button opens and closes a custom blueprint widget component using the following code
Go into the "Spawn Inventory" function. You'll notice this code is partially shared by the in-game inventory example in the normal sample project.
At the beginning of the function, we deterimine if this is a "Futurepass" style inventory we want to render, and make use of the Futurepass information cache to get the user's various addresses. We perform some string manipulation on them to take them from the format "ChainType:ChainId:Address" to just "Address". We then feed these into GetFuturepassInventory, which is then in turn fed into the widgets to be rendered.
Notably, in the lowest-level widget "InGameInventoryItem", there is an example of how to take a image URL from the given InventoryItem, get the texture for it and set it in a brush, to display it to the user.