Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to inverse growth direction of a sf::Text  (Read 1390 times)

0 Members and 1 Guest are viewing this topic.

klepz

  • Newbie
  • *
  • Posts: 5
    • View Profile
How to inverse growth direction of a sf::Text
« 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 ?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: How to inverse growth direction of a sf::Text
« Reply #1 on: February 14, 2018, 09:01:55 pm »
You'll have to do it manually, by moving the text object the correct width.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: How to inverse growth direction of a sf::Text
« Reply #2 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.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*