aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/sprite.cpp7
-rw-r--r--engines/draci/sprite.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp
index ecbfaf2767..e37d40dd46 100644
--- a/engines/draci/sprite.cpp
+++ b/engines/draci/sprite.cpp
@@ -364,6 +364,13 @@ void Text::draw(Surface *surface, bool markDirty) const {
Common::Rect Text::getRect(bool scaled) const {
return Common::Rect(_x, _y, _x + _width, _y + _height);
}
+
+void Text::setFont(Font *font) {
+ _font = font;
+
+ _width = _font->getStringWidth(_text, _spacing);
+ _height = _font->getStringHeight(_text);
+}
} // End of namespace Draci
diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h
index d2aa5ba3af..2fb668ba65 100644
--- a/engines/draci/sprite.h
+++ b/engines/draci/sprite.h
@@ -128,6 +128,7 @@ public:
void setText(const Common::String &str);
void setColour(byte fontColour);
void setSpacing(uint spacing);
+ void setFont(Font *font);
uint getLength();