SFML community forums

Help => Graphics => Topic started by: jlebrech on December 06, 2010, 01:10:29 pm

Title: Drawing numbers to text
Post by: jlebrech on December 06, 2010, 01:10:29 pm
I'm trying to do SetText( with an int inside it, so for example saying how much hp there is.

I'm stumped, I tried atoi, and casting and some other code i found that was supposed to do it, but no luck.

Help please :)


for example i'd like the following string written "hp:100/100".
Title: Drawing numbers to text
Post by: Groogy on December 06, 2010, 01:42:20 pm
Use: http://cplusplus.com/reference/iostream/stringstream/
And to get it as a std::string: http://cplusplus.com/reference/iostream/stringstream/str/
Title: Drawing numbers to text
Post by: Lupinius on December 06, 2010, 01:46:38 pm
http://www.sfml-dev.org/forum/viewtopic.php?t=3385
http://www.sfml-dev.org/forum/viewtopic.php?t=3217
Title: Drawing numbers to text
Post by: jlebrech on December 06, 2010, 02:08:42 pm
thanks, ever so helpful.