How to add dynamically an image in the HUD ?

Hello I currently develop a minigame, a very simple one to learn UE4.

The goal of this game is to pick up some banana or apple and each time I picked up a banana, I want to add an image banana.png on the right of the previous in the HUD and each time I picked up an apple, I want to add an image apple.png on the right of the previous in the HUD.

So my question is how to add a png image in the hud with the Blueprint Scripting.

Thanks in advance :smiley:

Several of the UMG UI Widgets have the ability to render an image. The most obivous one is the Image Widget.
To add multiple bananas into a row, you could use Wrap Box (or any other Widget with slots).
Just create (Create widget “item”) one of these, set the image and add the widget to your slotted panel.

The wildwest shootout example content project has a HUD which shows all the connected players. it’s actually the exact same principle, so I suggest you look at this.

PS: Search for “RefreshListMacro” on the wildwest documentation page, there you can see the whole blueprint for adding items to a list in UMG!

https://docs.unrealengine.com/latest/images/Resources/Showcases/BlueprintMultiplayer/Findgames6.jpg

Thanks I will check it :slight_smile: