SFML community forums

Help => Graphics => Topic started by: klepz on February 14, 2018, 08:24:30 pm

Title: How to inverse growth direction of a sf::Text
Post by: klepz on February 14, 2018, 08:24:30 pm
Hi, I need to making something like a LCD Clock, But the text grow up left to right, and I need right to left. How can I do this ?
Title: Re: How to inverse growth direction of a sf::Text
Post by: eXpl0it3r on February 14, 2018, 09:01:55 pm
You'll have to do it manually, by moving the text object the correct width.
Title: Re: How to inverse growth direction of a sf::Text
Post by: Hapax on February 17, 2018, 04:16:47 pm
Normally, I would change its origin to the right-hand side (the text's x + width) and then positioning the right-hand side where it needs to be. Note that the origin needs to be updated everytime the string changes.

If your font is monospaced, you can simply just pad the beginning of the string with spaces.