I apologize in advance, as i know this isnt the SFML forum, but Ive seen a good amount of forum goers that have knowledge of SFML. How would i display a varible on the screen that SFML creates? Say im trying to display the score on the screen after the player dies in a simple game. What code would i use? I know of the sf::String class, but doesnt it only display const pointer-to chars? Thanks for the help!
Just do any normal integer to string conversion. Assuming you're using SFML 1.6 (and not 2.0)
1 2 3 4 5 6 7 8 9
int score = 123456; // the score to print
sf::String mytext;
std::stringstream ss; // #include <sstream>
ss << score;
mytext.SetText( ss.str().c_str() );
// draw 'mytext' to your window