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/textparticle.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/textparticle.cpp')
-rw-r--r-- | src/textparticle.cpp | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/src/textparticle.cpp b/src/textparticle.cpp index 3494b97f..792b6bea 100644 --- a/src/textparticle.cpp +++ b/src/textparticle.cpp @@ -21,19 +21,17 @@ #include <guichan/color.hpp> -#include "graphics.h" #include "textparticle.h" -#include <SDL/SDL_ttf.h> + +#include "gui/textrenderer.h" TextParticle::TextParticle(Map *map, const std::string &text, - int colorR, int colorG, int colorB, + const gcn::Color* color, gcn::Font *font, bool outline): Particle(map), mText(text), mTextFont(font), - mColorR(colorR), - mColorG(colorG), - mColorB(colorB), + mColor(color), mOutline(outline) { } @@ -60,24 +58,7 @@ void TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const alpha /= mFadeIn; } - graphics->setFont(mTextFont); - if (mOutline) - { - graphics->setColor(gcn::Color(0, 0, 0, (int)(alpha/4))); - // Text outline - graphics->setColor(gcn::Color(0, 0, 0, (int)alpha)); - graphics->drawText(mText, screenX + 1, screenY, - gcn::Graphics::CENTER); - - graphics->drawText(mText, screenX - 1, screenY, - gcn::Graphics::CENTER); - - graphics->drawText(mText, screenX, screenY + 1, - gcn::Graphics::CENTER); - - graphics->drawText(mText, screenX, screenY - 1, - gcn::Graphics::CENTER); - } - graphics->setColor(gcn::Color(mColorR, mColorG, mColorB, (int)alpha)); - graphics->drawText(mText, screenX, screenY, gcn::Graphics::CENTER); + TextRenderer::renderText(graphics, mText, + screenX, screenY, gcn::Graphics::CENTER, + mColor, mTextFont, mOutline, false, (int)alpha); } |