Is there a detailed tutorial of ListView?

Hi, I am a newbie and want to make a UI that player can select mesh on the list, then they can place the mesh any where they want during playing the game.

I check that there are many ways to make a inventory UI, something like actor base inventory, component base inventory, data base inventory and I don’t know which is which and what differences they have, then I check inside user widget and I find out tileview might be something enough for me.

The problem for me right now is that I don’t know how to use tileview( listview ), there are few videos about listview on youtube, I watched all of them but they are not really explaining how listview work. They all said we need structure, A UObject for holding data, a listview widget, a entry widget, they show case how to make listview showing buttons with text of 0 to 40 but I still don’t understand how to make my tileview import and show meshes, it would be useful if someone can provide a detailed listview tutorial to me, I would also love to hear someone explain to me it here, that way I can even ask question that I don’t understand.

BTW, I am now thinking of manually making a array contain the meshes player selected, and try to import that array into tileview later on.
But I really want to know if there is a way to let UE auto import these meshes into array with path or something, I checked online “get assets by path” might be workable? But I also saw people said that you can’t do that with blueprint, but only CPP.

1 Like

Hi, I noticed this thread before, but it seems very complicated and different to other tutorial from youtube, there are nodes that I can’t create and follow the tutorial, but yeah I can rewatch the tutorial and see if I can understand that thing.

I try to follow the tutorial but don’t understand what is Add Item and Event On List Item Object Set for, I don’t why are they separated and I don’t know what to imple in Event On List Item Object Set.


the program won’t work.

You can implement your feature with the following steps:

  1. Create an Entry widget for your TileView:
    image

  2. Add list view interface to it:

  3. Add text to your entry widget to display mesh name:

  1. Set tour entry to the Tileview:
    image

  2. In your main widget, make a function to get list of meshes:

  3. Set meshes to the TileView:

Result:

TileView:

Listview:

You should prepare thumbnails for your meshes or make some tool to create them runtime.

Drag and Drop:

  1. Detect drag:

  2. On Drag Detected:

  3. Drop:

Result:
SpawnMesh

I’ve made a runtime scene outliner and content with treeview and tileview on blueprints:

5 Likes

Hi, @Supremative, your reply is super informative, but I am thinking could we use “get asset by path” to get assets inside a folder?

In my case, I download the free quixel megascans package from unreal store, I import it into my project, can we get all these meshes in this folder into the array with blueprint?

In current drag&drop code, the meshes will float at the sky and the distance is kinda hard to controll, is there a way to place them to the ground?

image

To spawn on a surface, use Linetrace.

1 Like

Hi, sorry to bother you again, but I really don’t understand how to use linetrace to get the function work correctly.

I try to follow tutorial in the internet, I tried location, impact point but somehow the hit result seems to always stay at (0,0,0) of the map.

Use GetMousePositionOnViewport:

ConvertMouseLocationToWorldSpace doesn’t work on dragging widgets.

1 Like

@Supremative REALLY REALLY THANK YOU!

I also add the get viewport scale from your last code and it works as a charm!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.