Hello
I want to use the sf::string class to print a variable, just as printf and sprintf in DOS.
I tried something like this:
//...
sf::Image Image;
sf::Font MyFont;
if (!Image.LoadFromFile("Bubbles.png") ||
!MyFont.LoadFromFile("arial.ttf", 50))
return EXIT_FAILURE;
sf::String Hello;
Hello.SetText("Pos y : %f Pos x : %f " ,Posy, Posx);
Hello.SetFont(MyFont);
Hello.SetColor(sf::Color(0, 128, 128));
Hello.SetPosition(100.f, 100.f);
Hello.SetRotation(15.f);
Hello.SetSize(50.f);
The coordinates ought to show the point of the picture, but it didnt work.
I figured out "SetText" can only contain a naked text without variables.
C:\...\main.cpp|34|error: no matching function for call to `sf::String::SetText(float&)'|
Now I wonder if there is any way to pass out a variable to the window with SFML.
In case I ignored something in the tuts don't be mean to me, please!
(I really was searching for the answer!)
Thank you : )