Creating a material instance for each button all good?

Hi, I have a squircle material which makes rounded boxes which I am currently using for a UMG button style.
When I create a button it’s sized to the text inside it, so the material has to change some size settings to make the rounded box look normal. (Otherwise the rounded corners aren’t ‘round’ but more oblong). So, for every button, I basically create a material instance and set the parameters to match the button size. There is no textures in the material and I am using the ‘GeneratedRoundedRect’ node.

Is this standard procedure? Thanks for any insight :slight_smile:

To demonstrate what I mean, notice how the bevelled element does not get distorted:

Image from Gyazo

As 0.4 (40%) of the image (counting from the the right hand side) is preserved as a fixed border edge.

(Otherwise the rounded corners aren’t
‘round’ but more oblong).

Look into how 9-slice works (called 9 Scale Box in UE4) - Setting Image States, here:

The margins control how much of the edges are preserved.


If all you want is rounded boxes on differently shaped buttons, 1 material instance is enough for this.

The above is just an image, making the gradient look wonky, it will look fine with a material, though!

Thanks for that! 9-Slice. What a peculiar term.

Thanks again :slight_smile:

EDIT: Well…All I did was make a circle and use it as a box with .5 margins and it’s a dynamic rounded box :smiley: I do everything the hard way haha. I had a seriously messy node graph…

There is a yellow splotch in the screenshot but it’s only there if you don’t look at it. Weird.