Texture Settings for UI Widget Backgrounds/Borders

Hello everyone !! :slight_smile:

I am learning Unreal 5.3.x after having used Unity since 2008.

I am trying to create some UI Widgets and I would like to know if in Unreal is possible to achieve something I was doing in Unity using their UGUI System.
Basically I would like to be able to set a background texture as sliced by specifying some borders. Doing this way I will be able to stretch the texture and use it as a background for a panel keeping the proportion of the 4 angles.

PLEASE NOTE:
because I am new in the forum, I cannot post a question with more than 1 embedded media, therefore, I strongly suggest you to take a look at this shared document that better explains what I mean using a few more screenshots.

I will now try to explain what I mean in words and 1 single image.

In Unity, I have a texture 64x64 imported as a Sprite.
Using the Sprite Editor I can then set some borders.
Having 2 different images with the same settings allows me to configure the texture borders as much as I like but, in essence, the texture used is the same.

With a sliced sprite I can create a panel stretching it as much as I like in both X and Y without modifying the 4 angles look’n’feel.
Basically, it’s the same as having the corners and the lines in separated textures and combining them to form some sort of border. In fact, if in Unity I will uncheck the FillCenter setting, I literally get

I tried to look on the Internet but the only tutorials I found are about having separated textures.

Could you please help me figure out if this same behaviour is achievable in Unreal 5.3?

Thank you very much !! :slight_smile:

This may be handy for you:

1 Like

Thanks, I will take a look !! :slight_smile:

EDIT
I took a look to the video and I think this doesn’t answer my question.
Is it pretty cool to see that in Unreal you can create a box and manage its shape natively giving you the possibility to create a few interesting shape without the need of having custom textures, however, when I normally create UI, I work in conjunction with UX/UI artists who provide custom skin designs that I have then to implement.
This implies the usage of custom textures.
I tried to play around with the Border widget but I was not able to replicate the same result I can achieve in Unity.
Maybe it was me not fully understanding the tool but I mostly think it was not what I am looking for.

Anyway, thank you very much for the resource you linked because it was really useful nonetheless !!! :wink:

1 Like

Also:

Scroll down to Setting Image States a.k.a. 9-slicing

BoxExample

You’re after the above, right?

2 Likes

This is exactly what I am looking for !!! :smiley:

The Unreal doc page you linked was for Unreal 4.6, as I mentioned I am on Unreal 5.3 and, I think, this is the correct link for that version !!

But, annoyingly, I cannot figure out how to apply the slicing to my texture.
This is what I am actually trying to do:


I would like to use the Border (or could also be directly a simple Image but I don’t know if I can achieve the 9-slicing with it) as the background for my panel and then add more stuff inside it (such as some text and a few buttons).

Although, as you can see, I am not able to “slice” style properly and the image looks really ugly. I need the image more tall than wide and at the moment it is just stretched.
I would like to share more screenshots but I cannot still add more than 1 media in my posts: I tried a few combinations but nothing is letting me do what I am trying to achieve…

Well, you’re not using the feature yet:

Once you’ve decided on the desired mode, use margins to dictate the behaviour. For this particular shape, you’ll need margins around 0.4. The actual math:

1 Like

So, this is what I came up with:


From 0.3 to 0.7 of the margins, the image looks exactly the same. Not exactly what I wanted that to look but I started understanding how this works, thank you !! :slight_smile:

I think I need to get different resources from the ones I was using in Unity: probably with a different texture I can actually achieve what I am trying to.

Do not go over .49 - that’d flip things over.

One critical bit is to start with the smallest image size you’ll ever need - slicing only works upwards.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.