SFML community forums

Help => Graphics => Topic started by: Smavery on January 01, 2025, 08:43:11 am

Title: How would I get the width of text in 3.0.
Post by: Smavery on January 01, 2025, 08:43:11 am
in 2.6 I could use "text.getLocalBounds().width" how would I do this in 3.0
Title: Re: How would I get the width of text in 3.0.
Post by: eXpl0it3r on January 01, 2025, 01:01:59 pm
sf::Rect has size and position as properties now, so in order to access width you'd call size.x.

Check out the migration guide for more details: https://www.sfml-dev.org/tutorials/3.0/getting-started/migrate/#sfrectt