summaryrefslogtreecommitdiff
path: root/src/text.cpp
diff options
context:
space:
mode:
authorsniper <sniper@livecd.janhome.net>2009-03-11 17:19:31 +0100
committerIra Rice <irarice@gmail.com>2009-03-12 21:03:20 -0600
commit393c1085ed1cb24092778594d2945a39428e41ad (patch)
treede676791f4cfdd7ef8a0cd8bcc2c1dae64dda885 /src/text.cpp
parent3ea4f74915184c08398bdf15e62d9667321ab15c (diff)
downloadmana-393c1085ed1cb24092778594d2945a39428e41ad.tar.gz
mana-393c1085ed1cb24092778594d2945a39428e41ad.tar.bz2
mana-393c1085ed1cb24092778594d2945a39428e41ad.tar.xz
mana-393c1085ed1cb24092778594d2945a39428e41ad.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.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/text.cpp b/src/text.cpp
index e5e40235..c167701a 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -26,6 +26,8 @@
#include "textmanager.h"
#include "gui/gui.h"
+#include "gui/palette.h"
+#include "gui/textrenderer.h"
int Text::mInstances = 0;
@@ -76,23 +78,9 @@ void Text::draw(gcn::Graphics *graphics, int xOff, int yOff)
{
graphics->setFont(boldFont);
- // Text shadow
- graphics->setColor(gcn::Color(0, 0, 0));
- graphics->drawText(mText, mX - xOff + 1, mY - yOff + 1,
- gcn::Graphics::LEFT);
-
- // Text outline
- 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,
@@ -107,9 +95,7 @@ void FlashText::draw(gcn::Graphics *graphics, int xOff, int yOff)
if (mTime)
{
if ((--mTime & 4) == 0)
- {
return;
- }
}
Text::draw(graphics, xOff, yOff);
}