I'm trying to set up a progress bar to act as a health bar and I was wondering if it's possible to display the current value inside the par as text. I've messed around with casting as a string but I've had no luck so far. Here's my base code:
//Health Bar
tgui::ProgressBar::Ptr hp = std::make_shared<tgui::ProgressBar>();
hp->setText("Health");
hp->getRenderer()->setBackgroundColor(sf::Color::White);
hp->getRenderer()->setForegroundColor(sf::Color::Red);
hp->setMaximum(10);
hp->setMinimum(0);
hp->setPosition(0,0);
hp->setValue(5);
gui.add(hp);
//Health Bar
tgui::ProgressBar::Ptr hp = std::make_shared<tgui::ProgressBar>();
hp->setText("Health");
hp->getRenderer()->setBackgroundColor(sf::Color::White);
hp->getRenderer()->setForegroundColor(sf::Color::Red);
hp->setMaximum(10);
hp->setMinimum(0);
hp->setPosition(0,0);
hp->setValue(5);
gui.add(hp);