Hi,
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.
and i have a update for the positions with widgets and it s ok
but for update progressBar->setValue i don't know how do to have the progressBars ?
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);
progressBar->setValue(m_eRPG->m_lavie[i]->getM_VieRestante());
m_gui.add(progressBar);
}
and i have a update for the positions with widgets and it s ok
Code Select
void guiWorld::update(sf::View v){
m_gui.setView(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 ?