SFML community forums

Help => Graphics => Topic started by: ico170 on May 06, 2013, 10:26:51 am

Title: sf::Clock
Post by: ico170 on May 06, 2013, 10:26:51 am
hy i am trying to print the value of the sf::clock as text,can anybody help me with that because i cant convert it to string...

how to make the float in to a sf::string?

i am using sfml 2.0
Title: Re: sf::Clock
Post by: Laurent on May 06, 2013, 10:30:46 am
Converting numbers to strings is a basic language feature, not something specific to SFML.

So: Google "C++ float to string" ;)
Title: Re: sf::Clock
Post by: ico170 on May 06, 2013, 11:59:57 am
i get the conversion but the clock doesnt want to print only text of current time but prints all the values beffore even if i put  string.clear();
Title: Re: sf::Clock
Post by: Laurent on May 06, 2013, 12:05:57 pm
Donc reuse the same stringstream. Either create a new one for every conversion, or call stringstream.str("") if you use the same instance.
Title: Re: sf::Clock
Post by: ico170 on May 06, 2013, 12:31:33 pm
that will work :) ty