Scaling for a text window

Ok, so I am having just way too much trouble figuring out how to set this widgit up.

Basically, I have two images that comprise the graphic portion of the text window, one is for the background of the image and the other is the actual border of the text box. What I need is for the images to scale down (stretch down?) vertically to fix the text inside.

I’ve been working with unreal on and off for a while now, but widgets and how they interact with each other on the hierarchy have been pretty challenging to understand.

Does anyone have any idea how to do this? This seems like something that should just work but nothing i’ve tried has…

Thank you all in advance for any help you can offer, it’s really appreciated.

1 Like

You can do this by using an overlay and taking advantage of padding.

image

With this method, it’ll start small, get to a certain horizontal width and then just extend vertically from there

Hierarchy:
image
The order is important for having them layer correctly (standard widget stuff).

  1. On the Overlay, make sure Size to Content is enabled

  2. On the Border, make sure the padding is less than the background (so it engulfs it) and the alignment is fill/fill
    image

  3. On the Background, make sure the padding is less than the text and the alignment is fill/fill
    image

  4. On the Text, make sure the padding is the highest of all. The alignment can be whatever you want- you may or may not need to change it depending on your padding.
    image

  5. Finally, set your wrap text at field on the text. This will decide how wide your text can get. Sadly there isn’t any way to get a constant aspect ratio- if you want that, you’ll have to make a system to dynamically change the Wrap Text At value based on the size.

1 Like

Sorry it took me so long to reply, I was very busy and AFK most of yesterday.

Thank you so much for your incredibly thorough explanation, I was not at all expecting visual aids! I think the part thats been tripping me up has been the wrapping. It seems very finicky, lol. Everything I’ve been reading had me putting things in textboxes and size boxes nested in size boxes, but his has helped me alot, and I think I understand it better. I now have a text box that scales downward :slight_smile: . Thank you.

2 Likes