Menu

Show posts

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.

Show posts Menu

Topics - Bryan9311

#1
Help requests / Value within progress bar
06 April 2016, 02:50:18
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);
#2
Help requests / Buttons within tabs
05 April 2016, 20:45:57
I'm in a semi-beginner programming class and our group project for the end of the semester is to create some sort of game. I'm in charge of creating the GUI and I'm wondering if there's a way to add buttons within the tabs I created. My vision is to make tabs for "Attacks" "Spells" and "Skills" with each tab having buttons corresponding to different abilities.

tgui::Tab::Ptr abilities = std::make_shared<tgui::Tab>();
abilities->setPosition(300,300);
abilities->add("Attacks");
abilities->add("Spells");
abilities->add("Skills");
gui.add(abilities);

For example in the "Attacks" tab, I would like to add a button for "Heavy Attack" and a button for "Quick Attack"