29 #include <guichan/rectangle.hpp>
30 #include <guichan/graphics.hpp>
36 #include "percentagebar.hpp"
49 void PercentageBar::draw(Graphics* graphics)
51 graphics->setColor(getForegroundColor());
55 graphics->fillRectangle(gcn::Rectangle(0,0,getWidth() *
mValue/100,getHeight()));
59 graphics->fillRectangle(gcn::Rectangle(0,getHeight()-getHeight() *
mValue/100,getWidth(),getHeight() *
mValue/100));
64 graphics->drawImage(mImage, 0, 0);
68 void PercentageBar::setForegroundImage(Image* image)
72 setHeight(image->getHeight());
73 setWidth(image->getWidth());