summaryrefslogtreecommitdiff
path: root/src/textparticle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-27 15:58:18 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-27 23:15:05 +0300
commit697e5bbf3171b0ba1fbbc0bbe61461c7726bf1ce (patch)
treee5cbf0d91a689a598193c7b7a292e7c711c49fdc /src/textparticle.cpp
parent60add2c149c9c61bfbede5ae92cfe216927aca8a (diff)
downloadplus-697e5bbf3171b0ba1fbbc0bbe61461c7726bf1ce.tar.gz
plus-697e5bbf3171b0ba1fbbc0bbe61461c7726bf1ce.tar.bz2
plus-697e5bbf3171b0ba1fbbc0bbe61461c7726bf1ce.tar.xz
plus-697e5bbf3171b0ba1fbbc0bbe61461c7726bf1ce.zip
Remove textrenderer class.
Diffstat (limited to 'src/textparticle.cpp')
-rw-r--r--src/textparticle.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/textparticle.cpp b/src/textparticle.cpp
index e3d3fc710..178a6a086 100644
--- a/src/textparticle.cpp
+++ b/src/textparticle.cpp
@@ -22,9 +22,12 @@
#include "textparticle.h"
-#include "textrenderer.h"
+#include "graphics.h"
+
+#include "gui/theme.h"
#include <guichan/color.hpp>
+#include <guichan/font.hpp>
#include "debug.h"
@@ -35,7 +38,8 @@ TextParticle::TextParticle(Map *const map, const std::string &text,
mText(text),
mTextFont(font),
mColor(color),
- mOutline(outline)
+ mOutline(outline),
+ mTextWidth(mTextFont->getWidth(mText) / 2)
{
}
@@ -66,13 +70,16 @@ bool TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const
/ static_cast<float>(mFadeIn);
}
- const gcn::Color color = *mColor;
-// color.a = (int)alpha;
-
- TextRenderer::renderText(graphics, mText,
- screenX, screenY, gcn::Graphics::CENTER,
- color, mTextFont, mOutline, false, static_cast<int>(alpha));
+ gcn::Color color = *mColor;
+ color.a = (int)alpha;
+ graphics->setColor(color);
+ if (mOutline)
+ {
+ graphics->setColor2(Theme::getThemeColor(
+ Theme::OUTLINE, static_cast<int>(alpha)));
+ }
+ mTextFont->drawString(graphics, mText, screenX - mTextWidth, screenY);
BLOCK_END("TextParticle::draw")
return true;
}