diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-03-18 18:37:19 +0100 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-03-18 18:37:19 +0100 |
commit | 1231406e5c9ac43d60c6ffb0ae664970b0e4eee0 (patch) | |
tree | 45af35e9a6ee56b71f06d76efa7706bf16eaec9a /src/text.cpp | |
parent | 04c189cf7e3e8a393c81bfb3e11058ceace8802a (diff) | |
parent | 4bd8d3fd96fab681ee4520b6a6f2a6ee73f6eb97 (diff) | |
download | mana-1231406e5c9ac43d60c6ffb0ae664970b0e4eee0.tar.gz mana-1231406e5c9ac43d60c6ffb0ae664970b0e4eee0.tar.bz2 mana-1231406e5c9ac43d60c6ffb0ae664970b0e4eee0.tar.xz mana-1231406e5c9ac43d60c6ffb0ae664970b0e4eee0.zip |
Merge branch 'master' of git@gitorious.org:tmw/eathena
Diffstat (limited to 'src/text.cpp')
-rw-r--r-- | src/text.cpp | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/src/text.cpp b/src/text.cpp index cb4587d3..b0be25bf 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; @@ -37,7 +39,7 @@ Image *Text::mBubbleArrow; Text::Text(const std::string &text, int x, int y, gcn::Graphics::Alignment alignment, - gcn::Color color, bool isSpeech) : + const gcn::Color* color, bool isSpeech) : mText(text), mColor(color), mIsSpeech(isSpeech) @@ -129,42 +131,14 @@ 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, gcn::Graphics::Alignment alignment, - gcn::Color color) : + const gcn::Color *color) : Text(text, x, y, alignment, color), mTime(0) { |