30#include <guichan/font.hpp>
33 int width,
int height,
35 mProgressPalette(color)
38 if (progress > 1.0f || progress < 0.0f)
46 setSize(width, height);
82 gcn::Rectangle rect = getDimension();
100 const float p = std::min(1.0f, std::max(0.0f, progress));
A central point of control for graphics.
Theme * getTheme() const
The global GUI theme.
void setProgress(float progress)
Sets the current progress.
ProgressBar(float progress=0.0f, int width=40, int height=7, int color=-1)
Constructor, initializes the progress with the given value.
void setColor(const gcn::Color &color)
Change the color of the progress bar.
void draw(gcn::Graphics *graphics) override
Draws the progress bar.
void setProgressPalette(int progressPalette)
Change the ProgressPalette for this ProgressBar to follow or -1 to disable this and manage color manu...
void logic() override
Performs progress bar logic (fading colors)
gcn::Color mColor
< Entry in ProgressPalette or -1 for none.
int getGuiAlpha() const
Get the current GUI alpha value.
void drawProgressBar(Graphics *graphics, const gcn::Rectangle &area, const gcn::Color &color, float progress, const std::string &text=std::string(), ProgressPalette progressType=ProgressPalette::THEME_PROG_END) const
static gcn::Color getProgressColor(int type, float progress)