X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgameobjs.cpp;h=5340bfb57b31712ce8c70592b46490391501aa3e;hb=e4db6eb50cd6bcba607858b5e6c4c5d53531ed1f;hp=b440b5cc1eed0e79d19742d9429c535623ce7f78;hpb=99ffd1de8f666bffa646064a587238803acec131;p=supertux.git diff --git a/src/gameobjs.cpp b/src/gameobjs.cpp index b440b5cc1..5340bfb57 100644 --- a/src/gameobjs.cpp +++ b/src/gameobjs.cpp @@ -114,7 +114,7 @@ BouncyBrick::draw(DrawingContext& context) draw_tile(context, shape.id, position + Vector(0, offset), LAYER_TILES+1); } -FloatingText::FloatingText(const Vector& pos, std::string& text_) +FloatingText::FloatingText(const Vector& pos, const std::string& text_) : position(pos), text(text_) { timer.start(1000); @@ -155,7 +155,12 @@ FloatingText::draw(DrawingContext& context) else alpha = 255; - context.draw_text(gold_text, text, position, LEFT_ALLIGN, LAYER_OBJECTS, NONE_EFFECT, alpha); + context.push_transform(); + context.set_alpha(alpha); + + context.draw_text(gold_text, text, position, LEFT_ALLIGN, LAYER_OBJECTS+1); + + context.pop_transform(); } /* Trampoline */