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

Author Topic: Width of an sf::String  (Read 1951 times)

0 Members and 1 Guest are viewing this topic.

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
Width of an sf::String
« on: December 22, 2010, 07:10:46 pm »
Hi, is there any way to get the width of an sf::String like in a sf::Sprite (sf::Sprite::GetSize().x).

I'm trying to create a window with "x" width and "x" would have the width of the sf::String.

Is this possible or I have to configure this manually?
Font size will be always 20.

Thanks in advance
 :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Width of an sf::String
« Reply #1 on: December 22, 2010, 07:12:42 pm »
Code: [Select]
string.GetRect().GetWidth()
Laurent Gomila - SFML developer

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
Width of an sf::String
« Reply #2 on: December 22, 2010, 07:21:19 pm »
Oh boy, I should read the documentation with more attention. Forgot about GetRect().
Thanks a bunch  :)

 

anything