void Action::update(sfg::ProgressBar::Ptr progressBar, Player& player) { if ((actionClock.getElapsedTime().asSeconds() / actionTime >= 1.0) || (actionTime == 0.0)) { active = false; progressBar->SetFraction(0.0); finishedMethod(); } else if (player.checkDistanceTileRef() >= 90) { active = false; progressBar->SetFraction(0.0); } else progressBar->SetFraction(actionClock.getElapsedTime().asSeconds() / actionTime); }
void ProgressBarExample::OnButtonClick() { // Generate random value for progress bar percent done float random_percentage = (float)rand()/(float)RAND_MAX; m_progressbar->SetFraction(random_percentage); }
void SampleApp::OnAdjustmentChange() { m_progress->SetFraction( m_scale->GetValue() / 100.f ); m_progress_vert->SetFraction( m_scale->GetValue() / 100.f ); }