1
Graphics / Integer to sf::Text
« on: May 09, 2012, 10:03:16 am »
I want to put an integer on my screen. Can somebody explain me, how i do it?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
int test = 32;
std::string sString_Spieler_Level = std::to_string(test); // <---fail
sf::String String_Level;
String_Level.SetFont (Font_Naruto);
String_Level.SetPosition (310,115);
String_Level.SetSize (20);
String_Level.SetColor (sf::Color::Yellow);
String_Level.SetText (sString_Spieler_Level);
// Level
std::string sString_Level( int Spieler_Level );
sf::String String_Level;
String_Level.SetFont (Font_Naruto);
String_Level.SetPosition (310,115);
String_Level.SetSize (20);
String_Level.SetColor (sf::Color::Yellow);
switch (Spieler_Level)
{
case 1:
{
String_Level.SetText ("TEST");
} break;
}
App.Draw (String_Level);