I'm currently coding a battle system, and I'm having a little trouble with displaying a number from a function.
What I need to do is display the hero's and enemy's hp, and to get the enemy's hp, i have a function that in a text based environment I used to call with:
cout << enemy.GetHP();
But I'm not to sure how to keep the number updated on the screen. I tried
sf::String anyText;
std::stringstream enemyhp;
enemyhp << enemy.GetHP();
anyText.SetText(enemyhp.str());
anyText.SetFont(Font);
anyText.SetSize(30);
anyText.SetColor(sf::Color::Black);
anyText.SetPosition(20.f,100.f);
and drew it on the screen, but it doesn't update
anyone know how i could do this?
Cheers,
Jake