[UMG] [UE4.24] Changing Item Brush in TileView is not working


I’m trying to create basic inventory. I’m using TileView (ListView). When creating a new item to that ListView, I can’t change image thumbnail by changing slate brush.
Here is my widget blueprint for filling items when inventory is created: (NOT WORKING - Set brush is not setting image per item)

The ListView: (Wrong - there should be different icon per item)

However, changing slate burush by the same process and at the end calling (Add to viewport) somehow works, but it will add the brush to full screen and not to ListView.

It looks like that ListView is somehow managing slate brushes in different way. :frowning: I’m confused.

If you have any tips, I would be really happy.

You are adding a widget as an item.
The problem is that the widget you are adding is not the widget that is displayed.
The listview generates entries (entry widgets) for each Item to be displayed. In order to modify the appearance of the entry, open the widget you added the userobjectinterface to and during the “On List Item Object Set” event, you can cast the Item and pull any properties of the Item.

In your case you could probably try having an UObject be the item, and the object only has a Name property that you set to be the data table row name. Then, in the Entry Widget, you cast the Item, grab the name, get the data table entry based on that name and get the thumbnail. The Entry widget would have the brush that you set the thumbnail to be.

Thank you for respond!

I changed the method a bit but it’s still not working.
In ListView:

ItemEntry:Unfortunately even this method didn’t work either: (In ListVIew)

The first image is set up correctly, more or less. I would not be using a widget as an item, since that seems to be confusing you.
The second image, you’re accessing the Item and changing properties of it. You want to change the image of the entry - not the item.
The third image should actually be working - if the Thumbnail Name was valid. But it’s not valid because you’re accessing the entry widget which has not had that property set. But stick with visuals in the entry instead, like the second image.

To clarify, the Item can be an Object, actor, character, vehicle or anything else. Even a widget. You’d then pull some properties from the Item and format the Entry Widget accordingly. Since you’re using a widget as an Item, you have a Widget Item and an Entry Widget, so you’re confusing which one holds the data and which one you should be formatting [the image].
You want to pull data from the Item and format the Entry Widget.

Hmm. Now I understand. Don’t know if it’s now what you meant but these solutons are wokring for me:

I was thinking that it works in the same way as widget parenting in ScrollBox case but actually no. You have to have two objects. One for data/logic/actor whatever and second for visual representation (widget). I can find a bit analogy in Map variable type here. (If I understood it correctly. :-D) Anyway, Thank you for explanation!