Text Jittering/Not fitting

Hey,

Every few weeks/Months, I hunt around for some fixes for this, but I’ve just never been able to fix this in years.

Text Just will not stay put. It breaks out of its barriers, overlaps things. Doesn’t shrink Or grow.
Or worst case, just jitters in place as it tries to figure out what it wants.

What’s the true method to just getting text to fill its space without giving a headache in the process?

Update:
Feels like the scale box and auto wrap are fighting for control?

Force Layout Prepass but that really depends on what we’re dealing with, you can easily sabotage it with:

scale box and auto wrap

But sometimes those are must-have for reasons too numerous to mention. Handling text can be super fiddly, I’ll give you that. I doubt there is one way to make it work in all scenarios.

Or worst case, just jitters in place as it tries to figure out what it wants.

Classic Text Block behaviour!

Ok Im Looking into force layout prepass.

When it comes to scale box and auto wrap,

I essentially just need my text to be the largest it can be while filling the box available.

:joy: :joy: :joy:
I fear I may have strayed into that terriotory that sounds easy on paper but actually is super nuonced and takes years to fully understand.

Ok So currently I have

My scale box settings are so.


-Ive kept stretch at none so it doesnt try and make adjustments vs the autowrap.
(Although thinking about it, surely this is what scales the text up or down in size to fit)

I have my auto wrap on and justified to the middle.

I essnetially have a sqaure box that I want the text to sit in the middle of. and to have the text shrink and grow depending on how many words it has.

image
As you can see the text spills out of the scale box.

So the 3 things fighting for top dog I guess are these.

  1. Scaling the text to fit the box.
  2. auto wrap the text to fit
  3. Size the text up and down to fit the box.
1 Like

Aye, sounds like a little nightmare. Perhaps it can be done. Could you show this widget’s hierarchy? And maybe explain who is the direct parent of this widget?

  • the viewport?
  • a widget component?
  • another widget? if so, what is the misbehaving widget sitting inside of?

Text Just will not stay put. It breaks out of its barriers, overlaps things. Doesn’t shrink Or grow.

All the time? Or when it’s updated?

image
This is the hierarchy And its a kind of global button text box, that I then use to put into widget menus and stuff. I also have the same thing for a non button version too.

singular words work fine most of the time, its once you have a sentance it spills out as its not scaling down the font down to fit.

Once the game boots its pretty persistant the whole time.

If I use one of the stretch options, It scales it to fit but then auto wrap has a field day as it tries to figure it out either to wrap or not.

Some of them It depends on the device, certain resolutions have the same jittering effect. where it flicks between small and large over and over.

Which means I need the scalebox to fit the text into the box. - So some form of stretch? (Reading the infomation, It seems “scale to fit” is the only one thatll really work)

While also have auto wrap to get it break the sentence down to make it as large as possible in the space available.

Update

Im wondering if scale box is just not the way to go.

Maybe a size box to mark out where I want it to be and then…maybe some form of font size adjustment depending on the box.

Update 2.

Or maybe using a scale box but turning auto wrap off. and then using wrap text at with a node that gets the size of the scale box and then adjusts it

update 3

Ok Actually What I might have to do is set the font individually for each item when its given out. I just need to work out how to change the font as an instance editable. (Im using a global text blueprint, Put into a global button that Im using everywhere)

1 Like