r/unrealengine • u/Tribalbob • May 28 '24
Nine Slice Help (UMG) UMG
Hey everyone,
I have a question - let's say I have this image:
https://i.pinimg.com/originals/44/32/1a/44321a0e2d00fea8fa8db0606d963c02.jpg
I want to turn this into a popup, and I want it to properly scale so I can use it as a small or a large popup, but I want it to nine-slice.
If I set it to Draw As Box, the edges stretch (As in, the tears along the edges will expand and distort). If I set it to Border, the edges will tile nicely, but I can't fill the center in with the texture. Is there a way to do this with Unreal's built-in tools, or am I stuffed?
1 Upvotes
1
u/monodrobe May 28 '24
built in directly prolly not. But with some UV manipulation you should be able to do it in a shader. GetUserInterfaceUV has a bunch of options including 9 slice uvs, which if you isoloate the edges of then you can manipulate into tiling UVs for your texture sample. You could also just manually do the 9 slice UVs yourself from scratch and just leave it as an image