SFML community forums

Help => General => Topic started by: Contadotempo on December 22, 2010, 07:10:46 pm

Title: Width of an sf::String
Post by: Contadotempo 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
 :)
Title: Width of an sf::String
Post by: Laurent on December 22, 2010, 07:12:42 pm
Code: [Select]
string.GetRect().GetWidth()
Title: Width of an sf::String
Post by: Contadotempo on December 22, 2010, 07:21:19 pm
Oh boy, I should read the documentation with more attention. Forgot about GetRect().
Thanks a bunch  :)