diff options
-rw-r--r-- | engines/draci/draci.cpp | 2 | ||||
-rw-r--r-- | engines/draci/sprite.cpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index 6558e777cf..4c4ed39ee3 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -129,7 +129,7 @@ int DraciEngine::go() { Common::String testString = "Testing, testing, read all about it!"; xpos = (kScreenWidth - _font->getStringWidth(testString, 1)) / 2; ypos = 130; - Text txt(testString, _font, kFontColour1, xpos, ypos, 1); + Text txt(testString, _font, kFontColour1, xpos, ypos, 0, 1); txt.draw(surf); diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index 43cab8838b..afabdf96ce 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -145,6 +145,9 @@ Text::Text(const Common::String &str, Font *font, byte fontColour, _colour = fontColour; _font = font; + + _width = _font->getStringWidth(str, _spacing); + _height = _font->getFontHeight(); } Text::~Text() { @@ -157,6 +160,9 @@ void Text::setText(const Common::String &str) { uint len = str.size(); _length = len; + _width = _font->getStringWidth(str, _spacing); + _height = _font->getFontHeight(); + _text = new byte[len]; memcpy(_text, str.c_str(), len); } |