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

Author Topic: Question in sf::Text  (Read 898 times)

0 Members and 1 Guest are viewing this topic.

flashrocket

  • Newbie
  • *
  • Posts: 21
    • View Profile
Question in sf::Text
« on: April 16, 2015, 02:56:45 pm »
I created sf::Text and used setPosition(50,50);.
but when i give getGlobalBounds(); I interestingly get the following
If you notice the attachment you see that top is showing 58 rather than 50.
  • Where is this extra 8 pixels coming from?
  • How to remove them?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Question in sf::Text
« Reply #1 on: April 16, 2015, 03:08:39 pm »
Text is aligned on its baseline, not on its top. You would get 50 if you had the tallest possible character in your string (like an accentuated capital letter).
Laurent Gomila - SFML developer

flashrocket

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Question in sf::Text
« Reply #2 on: April 16, 2015, 03:09:38 pm »
Thank You. 8) 8)