How to use Widget Scale Box on X Axis only

Hi all,
I wish to use the UMG Scale Box to scale text to fit on X axis only, meaning the text will stretch in a non-uniform scale.
Is this possible somehow? Open to other solutions besides scale box.
Attached is image showing the result I want.
Thanks!

In the details panel of the scale box you can go to the Stretching settings and on the Stretch Dropbox you can set it to Stretch To Fit X.
Look at the image below:

276507-fitx.png

Hope it helps! Make it a great day!

Hello.
Thanks for the answer but unfortunately this is not what I want, as this scales the text uniformly in both X and Y to fit the panel, whereas I want to scale only X (as seen in the image above) which would result in the text distorting.
A similar look is achieved by changing render transform, however I wish to auto scale to dimensions of the panel.

I find it a bit confusing - do you want to stretch it or scale it? These 2 are somewhat exclusive. For a simple non-uniform stretch, you can use Render Transform’s Scale - a setting available in any widget.

Render Transform scale is exactly what I want, I just need some way for it to scale to fill the panel though, dynamically resize based on the amount of characters in the text.

So it’s not about stretching?

Placing a widget on a canvas creates a canvas slot which can then SizeToFit (also referred to as AutoSize). Perhaps that’s what you need.

Somehow I feel I don’t fully understand what you’re trying to achieve. Consider attaching a quick sketch of how it’s suppose to behave.

Ive uploaded a new image above, I hope it makes it more clear. In this example there are 4 separate text boxes with the behavior I want.

Ugh. Now that’s clear, cheers. Lemme think about it. I’ll get back to you one way or another.

Will this have a fixed overall size? Or needs to by dynamic as well?

There’s no widget that can do it automatically but here’s a workaround.

Depending on where / when you use it, you may not need to Force Layout Prepass.

Wow hell yeah thank you so much!!
I am curious, why do you multiply by a value of 0.66?

I will test this asap and then (likely) mark as answered :slight_smile:

Oh, mental gymnastics only. An extra variable helping to see if I can get a variable baseline - I can, in this case it was the accurate text that does not scale. That’s why I asked whether the whole thing should scale dynamically.

If you just leave it as is, x1, the longest text will be the baseline that does not scale:

At x.5, it would be average of all lengths and scale to that ratio.