diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/text.cpp | 5 | ||||
-rw-r--r-- | src/text.h | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/text.cpp b/src/text.cpp index c4540dd4c..7dbaa7a20 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -178,6 +178,11 @@ void Text::draw(Graphics *const graphics, const int xOff, const int yOff) BLOCK_END("Text::draw") } +int Text::getWidth() +{ + return mTextChunk.img->getWidth(); +} + FlashText::FlashText(const std::string &text, const int x, const int y, const Graphics::Alignment alignment, diff --git a/src/text.h b/src/text.h index ae53a5984..38709f83b 100644 --- a/src/text.h +++ b/src/text.h @@ -76,6 +76,14 @@ class Text notfinal virtual void draw(Graphics *const graphics, const int xOff, const int yOff) A_NONNULL(2); + int getWidth() A_WARN_UNUSED; + + int getX() A_WARN_UNUSED + { return mX; } + + int getY() A_WARN_UNUSED + { return mY; } + private: Font *mFont; /**< The font of the text */ TextChunk mTextChunk; |