Regardless of how I set the text alignment, my bitmap fonts always align to the left. What am I doing wrong? Thanks
EDIT: Just realised this affects the alignment of the text within the paragraph, not the boundary box. So, I guess we need a way of getting the width the text and it can be positioned in the centre of the camera view width.
The alignment is weird, it only centers the text when multiple lines are displayed. And even then it is based on the paragraph width rather than the object width as you noticed. I’ve worked around this by either putting in a decorative line break of some sort (like a bunch of hyphens) that is as wide as the screen, or by adjusting the object placement after the fact
Thanks ZeroX4, I’ll test this tomorrow. Is the bitmap text width related to the boundary box or the actual text? e.g. if the text changes, does the width change accordingly?
Look your text from png atlas most likely have empty spaces
If you ask does AAA will take same space as WWW
That will depend on if your characters are mono space
Meaning if your characters no matter is it 1 or 8 or a or Z or L or i
They all take same space
Then 3 of any characters will have same width as any other 3 characters
If you ask does FOR EXAMPLE your 3 characters together makes your bitmap object width = idk let’s say 12 pixels
Then adding ANY new character will for sure increase width of your text object
Then yes you are right to assume so
BUT from what you read above
If you don’t have mono space font
Then it does not mean like
You change your text to
ASD and now width = 12 pixels
You change it to ASDasd now width IF its mono space will for sure = 24 pixels
Since 1 character would be 4 pixels so adding any new character would result in increasing width by 4 pixels
YET if they are not mono space like this very font we have on this forum
Look
1 2 3 4
! ! ! !
Well you see 4 characters in each row and 3 spaces
YET they do not occupy same space
So width of 1st row with numbers will be bigger than width of 2nd row with !