How to switch images on a widget

Hello guys, I hope to find someone who can clarify my doubts about interactions of blueprint + widget.

Basically, I have this widget (an inventory) popping up when I pres the “i” key.
My character can carry max 3 items.

When my character collects an item I would like to switch the image like that:

Taking this basic example (object disappear when is picked up), how can I add the switch of the image on my widget?

I use also a simple HUD related to my widget:

Hope to clarify this point.
Thanks a lot guys

If you look closely on the top screenshot the image is part of the widget’s brush. So on your widget use the Set Brush event.

could u give an example on how to use it sorry im kind of new ti ue4

I had the same question about changing an image, and was able to use a “Set Brush From Texture (Image)” node like Damir mentioned. Here’s a snippet of code where I am updating my HUD to change the Ammo Icon based on whether the current gun is empty or not.

  • ‘IsEmpty’ is a variable from my
    BaseGun blueprint.
  • ‘AmmoIcon’ is the
    name of the Image Widget I want to
    change.

3 Likes

I have a problem with changing the reticle because I performed a procedure to switch the sight on my rifle when I rotate the mouse wheel, so I have a series of reticles to choose from. The issue is that I can change them effectively, but the first reticle set always remains in the background within the image space, and the others can be replaced but end up overlapping the first reticle, which stays there continuously. How can I replace the initial reticle with the others, and where am I going wrong