I see it uses an entry widget but everytime i try to add things to the tile view it crashes my ue4, So i was wondering how do i populate the Tiles on the Tile View.
Your entry widget class must implement the required interface. The with *Object *in the name - canât recall precisely.
Iâve been learning how to use the tile view today and found it very unintuitive and not easy to debug.
In order to use the tile view :
- Create a widget which will be used to render your tile. It should implement the âUserObjectListEntryâ interface
- Create a variable on your new widget which will hold your custom data for the tile
- Implement the âGetListItemObjectâ method by returning your new variable
- Implement the âOnListItemObjectSetâ method by setting your new variable to what is passed in
- Add your data to the TileView when you set it up (probably in PreConstruct with an array of data you need to view)
The tile view will create only as many child widgets it requires to render all the currently viewable tiles. If you donât implement the hooks that the tile view calls to render your widgets (by setting up your widget with the data passed when it changes) youâll just see your widget with itâs default data. In this way you can have thousands of data items, but the tile view will only create a few actual widgets so it will still be performant.
As far as I can tell the TileView only renders your proper customized data at runtime, the designer view will just have your custom widget with its default data.
Above post helped me a lot but to clarify a bit further:
You need an âitem templateâ widget that implements UserObjectListEntry interface, then select it in âEntry Widget Classâ field in your Tile View widget.
To implement that interface you need an object instance that holds the data used to populate your template widget.
In my case itâs redundant, had to create UObject that duplicates data (item name, item class) instead of spawning full actor just to populate the menu.
To populate the list, create instances of your data object and pass them to TileList->AddItem (instead of creating widget instances)
https://answers.unrealengine.com/answers/862448/post.html for clear explanationâŚ
I know this post is not really up to date but I canât get it working properly for me. Can someone please explain to me how to:
- Implement the âGetListItemObjectâ method by returning your new variable
- Implement the âOnListItemObjectSetâ method by setting your new variable to what is passed in
- Add your data to the TileView when you set it up (probably in PreConstruct with an array of data you need to view)
I get it working so far that it creates the Tile View on the right, but in the white square there should be a thumbnail from a pickaxe. But whatever I try it doesnât show up.
I was stuck here for a while and spent hours trying to understand, apparently you need another UObject Class Actor in between to pass the variable data through. Have a look here, it has been extensively explained : https://forums.unrealengine.com/community/community-content-tools-and-tutorials/1595437-listview-getting-started-in-bp