How do you use the “Set” node for an image variable in order to change the image based on other conditions? When I try, the asset list comes up empty.
If the scenario I described is NOT how you use blueprints to manipulate image widgets, then please provide detailed instructions for the setup,
Go to widget and add an image to it, then under the Appearance tab bind Brush to a function.
Open up the bound function graph and drag the return value pin and choose ‘Make SlateBrush’
Expand the node. On the bottom, you can see the image pin. Promote it to a variable then compile and set an initial image for that (this is the image you already have).
Inside the HUD blueprint (where the widget is added to the view port), cast to the widget and by dragging off the ‘As Widget’ pin, get Image.
A target node will come up. Drag again from the target this time and choose ‘Set Brush’ node. Just like in widget, choose ‘Make SlateBrush’.
Expand it and promote the image to a variable (like what you did inside the widget BP). Click compile and set an image for the variable (this is the image you want to have).
You are done.
It appears a little complicated but the logic is just like any other variable.
Hello AAA Games,
For this using Texture2D. There simply example in below.