![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | cookieKing_ |
I’m making a clicker game and I added a money counter that’s a RichTextLabel, but I want the text to be centered.
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | cookieKing_ |
I’m making a clicker game and I added a money counter that’s a RichTextLabel, but I want the text to be centered.
![]() |
Reply From: | jgodfrey |
You can control the text alignment via bbcode tags. So…
Bbcode Enabled
in the control’s inspector[center]...[\center]
tags. Something like:[center]This is my centered text.[/center]
When I do that, it says:
Expected end of statement after expression, found “Identifier” instead.
This is the code for the text label:
$Money.text = [center]str(GlobalVariables.money)[/center]
cookieKing_ | 2023-04-16 22:25
Try something like this:
$Money.text = "[center]%s[/center]" % GlobalVariables.money
jgodfrey | 2023-04-16 23:36
It worked, thanks!
cookieKing_ | 2023-04-16 23:42