83 #include <guichan/rectangle.hpp>
84 #include <guichan/graphics.hpp>
99 setHeight(image->getHeight());
100 setWidth(image->getWidth());
104 void Icon2::draw(Graphics* graphics)
107 graphics->drawImage(mImage, 0, 0);
111 void Icon2::drawFrame(Graphics* graphics)
113 Color faceColor = getBaseColor();
114 Color highlightColor, shadowColor;
115 int alpha = getBaseColor().a;
116 int width = getWidth() + getFrameSize() * 2 - 1;
117 int height = getHeight() + getFrameSize() * 2 - 1;
118 highlightColor = faceColor + 0x303030;
119 highlightColor.a = alpha;
120 shadowColor = faceColor - 0x303030;
121 shadowColor.a = alpha;
124 for (i = 0; i < getFrameSize(); ++i)
126 graphics->setColor(shadowColor);
127 graphics->drawLine(i,i, width - i, i);
128 graphics->drawLine(i,i + 1, i, height - i - 1);
129 graphics->setColor(highlightColor);
130 graphics->drawLine(width - i,i + 1, width - i, height - i);
131 graphics->drawLine(i,height - i, width - i - 1, height - i);
135 void Icon2::setImage(Image* image) {
138 setHeight(image->getHeight());
139 setWidth(image->getWidth());