This feature is in an Experimental state so you can try it out, provide feedback, and see what we are planning. You cannot publish a project that uses Itemization at this time.
Please keep in mind that we do not guarantee backward compatibility for assets created at the experimental stage, the APIs for these features are subject to change, and we may remove entire Experimental features or specific functionality at our discretion. Check out the list of known issues before you start working with the feature.
The item_icon_component
is a Scene Graph component used to assign an icon to an entity. For how to add a component to your entity, see Working with Entities and Components.
Entities are only considered items if they have an item_component. Without one, entities will not be added to inventories properly as well as Custom Item and Inventories functionality may be broken.
References to an “item” are referring to an entity with an
item_component.References to “inventories” are referring to an entity with an
inventory_component.
Class Description
An item_icon_component uses a Texture asset as a visual reference to the item in-game. The item_icon_component also provides a way to control the texture through variables and functions in the Custom Items and Inventories system.
The component property is <protected> and can only be modified at instantiation or by subclassing the component and defining them inside the subclass.
Once the Custom Items and Inventories system is enabled the item_icon_component is listed in the component dropdown list. For more information check out
the item_icon_component API reference from the Verse API.
Example
With Verse, the item_icon_component can be assigned a value through the component’s texture slot in the user options. The texture can be updated using a program to detect when the item is removed from the inventory’s item slot.
You can use the examples below to set up the item_icon_component in your project using Verse.
using { /Verse.org/Assets }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Itemization }
using { /Verse.org/SceneGraph }
using { /UnrealEngine.com/Itemization }
using { /UnrealEngine.com/Temporary/UI }
using { /Verse.org/Simulation }
# This device will create an item entity with an item_icon_component.
Below is an example of how to convert the texture inside the item_icon_component into a widget displayed using Verse UI.
# This function will display a texture block widget to the player screen.
# It sources the texture from the item_icon_component from the provided entity.
DisplayIconWidget(Player:player, Item:entity):void=
if:
IconComponent := Item.GetComponent[item_icon_component]
PlayerUI := GetPlayerUI[Player]
then:
IconWidget := texture_block{DefaultImage:= IconComponent.Icon}
PlayerUI.AddWidget(IconWidget)To learn more about using Verse to create user interfaces (UI), see Creating UI with Verse.