How to use UI material?

I must be missing something simple. I create a very simple user widget. Has a canvas and an image. I created a brush, set a material on it and assigned the brush to the image.

It doesn’t work. My material does not show up. I’ve read tutorials, watched youtube videos. What the tutorials and youtube videos do simply doesn’t work for me.

I tried using a binding on the brush and that doesn’t work either. What am I missing?

I tried removing the material. So just binding a brush variable on an Image widget doesn’t work.

If I remove the binding, I can change the settings on the brush in the image widget and that updates, so there’s nothing overlapping. There’s also nothing connected in any of the graphs.

edit: I’m using UE 5.1

Something is seriously wrong. I’m getting nodes disappearing from various material blueprints. This is getting very frustrating.

Hey! I’ll help you out, give me a second.

I made a simple material, make sure the Material Domain is set to User Interface.

Add the material to the Brush → Image:

That works fine. But I want a binding on the brush. If I use a binding, it doesn’t work.

Alright, what shall the binding do? What controls the binding?

I’m using a material instance and want to set the values. I’m not changing them after construction, so I was able to get it to work with “Set Brush from Material” in the construction script.

But bindings still don’t work for me. Guess I’ll have to work around that from now on.

Just create a brush variable and change the color. Then use that brush variable as the binding. Does the color change for you?

You don’t even need to use a material.

I see, well here is my setup to change the properties of the brush with a slider.

I turned this into a parameter called color:
bild

To change this material and properties it needs to be a dynamic material. So I run the node called: Create Dynamic Material Instance and make it into a variable. I then use Set Brush to set the new material on the Image brush.

If you don’t see the full list I have on the Set Brush node, right click on the In Brush node input and Split Struct Pin:
bild

You can then use this to modify the color:

I’ll soon post a solution when it comes to binding.

1 Like

Binding is mostly used to bind for the values that you see in the appearance. You can create your own structs which can receive a binding, but this is how you would bind a slider and change a value with it.

Create a binding:

Plugin a value to control the binding, I am basically getting the Slider value and setting the tint.

I can now change the color with a binding using this slider:

That doesn’t work for me.

I can set any value I want in the return node with no effect.

What doesn’t work? Show me what you have done. Post images of all nodes and the setup you have.

Anything set in the return node is completely ignored. I’m just trying to set the color to green. Doesn’t work. Doesn’t work in game either. I can connect variables or whatnot and none of it works.

There is nothing in setup. Only the binding is set to the function.

Try this

  1. Create a new image (Don’t change any settings)
  2. Create a new binding for image
  3. Create a new slider

Do the same of what I did here:

Does it work?

Yeah, it works when I add a slider. I don’t even need to use the slider. Just having it displayed makes the return node work. This has got to be a bug or I have a bad build or something.

Great that you got it solved! The system works, and it seems like you are trying to do something that I can’t help you with.

Best of luck! :slight_smile:

It’s not solved. I’m getting inconsistent behaviour. I removed the slider and it still works. But the other widget doesn’t. Anyhow, I’ll just use the setup code I have above. That seems to work fine.

Oh, and even when the binding works, it doesn’t update in the editor. Maybe that’s just how it works. Dunno.

Anyhow, thanks for helping. I appreciate it.

Oh, and even when the binding works, it doesn’t update in the editor. Maybe that’s just how it works. Dunno.

Yes, the binding only works when the game is running. So you will need to test in real time.