]> Shamusworld >> Repos - apple2/blobdiff - src/gui/text.cpp
Added floppy #2 saving, statistics to makefile.
[apple2] / src / gui / text.cpp
index 2dbae7eaa0ab12ddfa22bc055152484f16efc196..34e01403c604419448a8712237a6e65c7d664014 100644 (file)
@@ -1,20 +1,20 @@
 //
 // Static text class
 //
-// by James L. Hammons
+// by James Hammons
 //
 
 #include "text.h"
 
 #include "guimisc.h"
 
-Text::Text(uint32 x/*= 0*/, uint32 y/*= 0*/, uint32 w/*= 0*/, uint32 h/*= 0*/, Element * parent/*= NULL*/):
+Text::Text(uint32_t x/*= 0*/, uint32_t y/*= 0*/, uint32_t w/*= 0*/, uint32_t h/*= 0*/, Element * parent/*= NULL*/):
        Element(x, y, w, h, parent)
 {
        fgColor = 0xFF8484FF, bgColor = 0xFF84FF4D;
 }
 
-Text::Text(uint32 x, uint32 y, std::string s, uint32 fg/*= 0xFF8484FF*/, uint32 bg/*= 0xFF84FF4D*/, Element * parent/*= NULL*/):
+Text::Text(uint32_t x, uint32_t y, std::string s, uint32_t fg/*= 0xFF8484FF*/, uint32_t bg/*= 0xFF84FF4D*/, Element * parent/*= NULL*/):
        Element(x, y, 0, 0, parent), text(s)
 {
        fgColor = fg, bgColor = bg;
@@ -23,6 +23,14 @@ Text::Text(uint32 x, uint32 y, std::string s, uint32 fg/*= 0xFF8484FF*/, uint32
 void Text::Draw(void)
 {
        if (text.length() > 0)
+       {
 //             DrawString(screenBuffer, extents.x + offsetX, extents.y + offsetY, false, "%s", text.c_str());
-               DrawStringOpaque(screen, extents.x, extents.y, fgColor, bgColor, "%s", text.c_str());
+               SDL_Rect r = GetScreenCoords();
+               DrawStringOpaque(screen, r.x, r.y, fgColor, bgColor, "%s", text.c_str());
+       }
+}
+
+void Text::SetText(std::string s)
+{
+       text = s;
 }