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

Author Topic: Text width?  (Read 5409 times)

0 Members and 1 Guest are viewing this topic.

danikaze

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • Email
Text width?
« on: September 06, 2012, 01:45:07 am »
Hello there!

I'm new in SFML (I come from allegro/gosu/others) and I wonder if there's any way to know the width of a text.

I noticed there isn't any method such as float Text::width() that returns the size in pixels of the Text string.

Why do I need this? Well, to draw my text into boxes (with lines limited by a certain number of pixels) and have a custom format system (to change style, color...) which will draw the text by parts.

So is there (or will be in the 2.0) any function to know that?

Thank you in advance!

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Text width?
« Reply #1 on: September 06, 2012, 02:55:26 am »

danikaze

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • Email
Re: Text width?
« Reply #2 on: September 06, 2012, 01:31:40 pm »
Oh thanks! I'm in the process of changing my library to SFML and it's just that question popped in my head!
Still have to get used to the library ;)

Thanks again!