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.

Messages - psycosium

Pages: [1]
General Discussion / Re: update the progressbars
« on: 28 July 2016, 17:54:27 »
if i use std::vector<tgui::ProgressBar::Ptr> how i draw the elements ?

i can do
std::vector<tgui::ProgressBar::Ptr> myProgressBar;

void game::draw(sf::RenderTarget& target, sf::RenderStates states) const{

for (int i=0;i<myProgressBar.size();i++)
target.draw(myProgressbar, states);


General Discussion / Re: update the progressbars
« on: 28 July 2016, 13:57:04 »
Thank you very much for the quick response

Are you using multiple Gui objects perhaps?
yes, currently i use for one for the defaut view for the interface. And another for the progresseBar who is the view in the game.
The code that you show might give some problems later on though.
lol i understand if a entite is deleted it's a big probleme

General Discussion / update the progressbars
« on: 28 July 2016, 12:28:20 »
Sorry for my bad english and thinks for your libray.
i want update the progressbars for my entite but i don t know how do that.

i have a class how initializes progressBars.
Code: [Select]
for (unsigned int i=0 ;i<m_eRPG->m_lavie.size();i++){
        std::cout<<"nb de progresse bar "<<i<<std::endl;
        tgui::ProgressBar::Ptr progressBar ;
        progressBar = theme->load("ProgressBar");
        progressBar->setSize(30, 5);

and i have a update for the positions with widgets and it s ok

Code: [Select]
void guiWorld::update(sf::View v){

    std::cout<<"widgets ="<<m_gui.getWidgets().size()<<std::endl;

    for(int i=0;i<m_gui.getWidgets().size();i++){
         m_gui.getWidgets()[i]->setPosition(m_eRPG->m_lavie[i]->getPosition().x*32+5,  m_eRPG->m_lavie[i]->getPosition().y*32-30);


but for update progressBar->setValue i don't know how do to have the progressBars ?

Pages: [1]