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
Everynone
(Everynone)
January 24, 2022, 9:30am
4
Is there a reason why you cannot use justification?
I tried it before posting, it didn’t work with my custom font.
Everynone
(Everynone)
January 24, 2022, 12:04pm
6
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:
Everynone
(Everynone)
January 24, 2022, 12:57pm
8
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.
Everynone
(Everynone)
January 24, 2022, 1:23pm
10
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:
And then offset as needed.
Another solution is to wrap the text with a translucent border, should also work OK.
Good luck!
1 Like