summaryrefslogtreecommitdiff
path: root/src/text.cpp
diff options
context:
space:
mode:
authorsniper <sniper@livecd.janhome.net>2009-03-11 17:19:31 +0100
committerJared Adams <jaxad0127@gmail.com>2009-03-12 18:53:16 -0600
commitc7fa79ff1704d86e12e12b83e1e4745ca27a543a (patch)
tree6b55903486c3543f0d1608cc1465702c368c6327 /src/text.cpp
parent4260cb92571842c6336537bf0d0c47c4f011ac0f (diff)
downloadmana-c7fa79ff1704d86e12e12b83e1e4745ca27a543a.tar.gz
mana-c7fa79ff1704d86e12e12b83e1e4745ca27a543a.tar.bz2
mana-c7fa79ff1704d86e12e12b83e1e4745ca27a543a.tar.xz
mana-c7fa79ff1704d86e12e12b83e1e4745ca27a543a.zip
Added a class for rendering of floating text
This is a header only-class that merges the textrendering of the TextParticle and Text classes. It is done to reduce code duplication and to prepare some color configuration gui.
Diffstat (limited to 'src/text.cpp')
-rw-r--r--src/text.cpp36
1 files changed, 5 insertions, 31 deletions
diff --git a/src/text.cpp b/src/text.cpp
index cb4587d3..5a912d17 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -30,6 +30,8 @@
#include "resources/image.h"
#include "gui/gui.h"
+#include "gui/palette.h"
+#include "gui/textrenderer.h"
int Text::mInstances = 0;
ImageRect Text::mBubble;
@@ -129,37 +131,9 @@ void Text::draw(gcn::Graphics *graphics, int xOff, int yOff)
*/
}
- // Text shadow
- graphics->setColor(gcn::Color(0, 0, 0));
- graphics->drawText(mText, mX - xOff + 1, mY - yOff + 1,
- gcn::Graphics::LEFT);
-
- if (!mIsSpeech) {
- graphics->setColor(gcn::Color(0, 0, 0, 64));
- /*
- // TODO: Reanable when we can draw it nicely in software mode
- graphics->drawText(mText, mX - xOff + 2, mY - yOff + 2,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff + 1, mY - yOff + 2,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff + 2, mY - yOff + 1,
- gcn::Graphics::LEFT);
- */
-
- // Text outline
- graphics->setColor(gcn::Color(0, 0, 0));
- graphics->drawText(mText, mX - xOff + 1, mY - yOff,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff - 1, mY - yOff,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff, mY - yOff + 1,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff, mY - yOff - 1,
- gcn::Graphics::LEFT);
- }
-
- graphics->setColor(mColor);
- graphics->drawText(mText, mX - xOff, mY - yOff, gcn::Graphics::LEFT);
+ TextRenderer::renderText(graphics, mText,
+ mX - xOff, mY - yOff, gcn::Graphics::LEFT,
+ &mColor, boldFont, !mIsSpeech, true);
}
FlashText::FlashText(const std::string &text, int x, int y,