I’ve found that Unreal’s basic 9-slicing tool for images and UI materials seem pretty bad, or I’m just not understanding how it works.
I want to make my own 9-slicer because i feel hampered by the tools that are out there already, but for the life of me i can’t seem to find any good information on how to do it.
So the question is, how can I separate an image or material into it’s segments based on inputted margins? Is there a resource somewhere I’ve not found yet that can help me discover what I desire?
Wow i did not get any notification that i was replied to!
Thanks for the reply and demonstration! This cleared up some of my confusion, after a bit of messing around with it.
Something i noticed was that you’re using a canvas panel here, and when i try using that as well and move stuff around and fiddle with material sizes and such, it works pretty well. However, it doesnt seem to work the same without a canvas panel. I generally try to avoid stacking canvas panels, so i guess thats why im having issues with it. it seems to be visualized much differently outside a canvas panel.
What i’m really looking for, is how to make a 9-slicer using materials. I want to be able to take any image i want, use it as a material texture, and then manipulate parameters to scale the material itself without using the default 9-slicer. this way, i can make all my stuff work within my lower level widgets, and they can work perfectly no matter where i design the widget, and without using canvas panels.
Canvas here to demo only - for the dramatic and visually convincing effect.
A widget needs Desired Size, it comes from a parent - be it a border, a size box, a canvas, or directly from the viewport, or anything, really. The child conforms to it.
Admittedly, the behaviour of a material being 9-sliced is slightly different than that of a simple image. Perhaps you could provide an example of what is not working as expected.
Somehow I feel you’d reinvent the wheel and end up with what the 9-slicer does. One way or another, it’s just a bunch of math - you could take apart the existing solution, see what it does (wrong).
I had tried doing the same thing in the canvas, and doing it by manipulating a sizebox and i got different results. Trying again and now it works similarly. idk, maybe i did something wrong before.