Draw Text RTL?

Hello,

is there a chance to draw text with “right to left” btw. align right?

No idea? :frowning:

It’s not something built right into the Draw Text node as far as I know. However, you could accomplish a rough approximate of this with some math. You’ll need to find out approximately how wide one letter of your font is, and multiply that by the number of letters/characters in the string and subtract that from the x coordinate.
So the X coordinate of your draw string node should be: Screen X (from drawhud node) - Right indent - Calculated length of string

This may not work particularly well, however. Depending on your font, I can almost guarantee that not all of the characters are the same width.

There is actually a function which does that for you, it’s named “Get Text Size”,
it will output the height and width of your text based on your desired font!

For center alignment you want to divide the width/height by 2,
for right-to-left alignment just take your desired position on screen minus the width.

We don’t yet have proper support this though you can right-align your text using Slate. You can simply align your textblock to the right or for other scenarios you can use the SRichTextBlock Alignment option.

Hopefully we’ll be getting proper support for this in the future.