SFML community forums
Help => Graphics => Topic started by: Mikea on February 01, 2009, 09:59:19 pm
-
I'd like to write numbers on screen, like time and/or scores. How can I do that if sf::String only allows text.. ?
-
use a string output stream?
that would be my guess.
EDIT: Check this out: http://www.fredosaurus.com/notes-cpp/strings/stringstream.html
http://notfaq.wordpress.com/2006/08/30/c-convert-int-to-string/
-
http://www.sfml-dev.org/forum/viewtopic.php?t=116
-
yes there you go, a link to another topic on this forum ^_^
-
thank you :) although to update time this method only appends the text. I tryied to flush the stream but it keeps appending the numbers... example:
Score 1
Update
Score 12 instead of Score 2
-
Tu remove the contents of a stringstream you have to call its str("") function, not clear() or flush().
-
sweet THANKS :D