x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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!

alt text

Product Version: UE 4.22
Tags:
umg.jpg (237.4 kB)
more ▼

asked May 10 '19 at 10:02 AM in Blueprint Scripting

avatar image

troydSPAMBOT3000
41 1 6 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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:
alt text

Hope it helps! Make it a great day!

fitx.png (25.8 kB)
more ▼

answered May 10 '19 at 11:17 AM

avatar image

Bariudol
1.4k 24 14 29

avatar image troydSPAMBOT3000 May 10 '19 at 11:54 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered May 10 '19 at 01:11 PM

avatar image

Everynone
15.3k 77 26 64

avatar image troydSPAMBOT3000 May 10 '19 at 01:24 PM

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.

avatar image Everynone May 10 '19 at 01:33 PM

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.

avatar image troydSPAMBOT3000 May 10 '19 at 01:54 PM

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.

avatar image Everynone May 10 '19 at 02:03 PM

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

avatar image Everynone May 10 '19 at 02:01 PM

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

avatar image Everynone May 10 '19 at 02:32 PM

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

alt text

alt text

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

cap2.png (59.8 kB)
cap3.png (246.6 kB)
avatar image troydSPAMBOT3000 May 10 '19 at 02:58 PM

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 :)

avatar image Everynone May 10 '19 at 03:43 PM

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:

alt text

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

capture.png (58.8 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question