Text Flow Direction

Hi everyone, so I have this HighScore text widget that I wanna keep centered after reaching 10.
This is the default 0 value, perfectly centered:


This is what it looks like from 10 up:

This is what I want it to look like after it reaches 10 dynamically:

Thanks in advance.
EDIT: I thought about adjusting the text’s transform in 2d space after it reaches 10 (max is 99 anyways) but thought I’d ask first.

You could just extend 1 to 01, 2 to 02, and so on.

Ye but I like the looks of a single digit tbh

Is there a reason why you cannot use justification?

I tried it before posting, it didn’t work with my custom font.

Could we see the hierarchy of the widget?

This is a grouping canvas anchored to the right of the screen:


This is how it’s set up:
image

Does justification work with standard font?

It doesn’t work with the standard font either.
I have found the solution tough, for some reason, “set size to content” and justification don’t get along.
Thanks for your time.

The container probably resizes using its anchor which, by default, is in the upper left corner. This can be adjusted by ctrl+shift+click here:

image

And then offset as needed.


Another solution is to wrap the text with a translucent border, should also work OK.

Good luck!

1 Like