]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/text.cpp
Major refactoring of GUI: Phase I
[virtualjaguar] / src / gui / text.cpp
1 //
2 // Static text class
3 //
4 // by James L. Hammons
5 //
6
7 #include "text.h"
8
9 #include "guimisc.h"
10
11 Text::Text(uint32 x/*= 0*/, uint32 y/*= 0*/, uint32 w/*= 0*/, uint32 h/*= 0*/):
12         Element(x, y, w, h), fgColor(0xFF8484FF), bgColor(0xFF84FF4D)
13 {
14 }
15
16 Text::Text(uint32 x, uint32 y, std::string s, uint32 fg/*= 0xFF8484FF*/, uint32 bg/*= 0xFF84FF4D*/):
17         Element(x, y, 0, 0), fgColor(fg), bgColor(bg), text(s)
18 {
19 }
20
21 void Text::Draw(uint32 offsetX/*= 0*/, uint32 offsetY/*= 0*/)
22 {
23         if (text.length() > 0)
24 //              DrawString(screenBuffer, extents.x + offsetX, extents.y + offsetY, false, "%s", text.c_str());
25                 DrawStringOpaque(screenBuffer, extents.x + offsetX, extents.y + offsetY, fgColor, bgColor, "%s", text.c_str());
26 }