From: Ricardo Cruz Date: Fri, 24 Sep 2004 18:01:42 +0000 (+0000) Subject: Made changes to reflect change of way that alpha applied is handled. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4ef3e7a7e70bdf7a2c53ad3bc7563625ea22a79b;p=supertux.git Made changes to reflect change of way that alpha applied is handled. SVN-Revision: 1967 --- diff --git a/src/gameobjs.cpp b/src/gameobjs.cpp index 1ace86caa..5340bfb57 100644 --- a/src/gameobjs.cpp +++ b/src/gameobjs.cpp @@ -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 */ diff --git a/src/statistics.cpp b/src/statistics.cpp index 5c5731358..0b9cc0a25 100644 --- a/src/statistics.cpp +++ b/src/statistics.cpp @@ -108,14 +108,6 @@ Statistics::draw_worldmap_info(DrawingContext& context) display_stat = 1; } - int alpha; - if(timer.get_gone() < FADING_TIME) - alpha = timer.get_gone() * 255 / FADING_TIME; - else if(timer.get_left() < FADING_TIME) - alpha = timer.get_left() * 255 / FADING_TIME; - else - alpha = 255; - char str[128]; context.draw_text(white_small_text, _("- Best Level Statistics -"), @@ -130,6 +122,17 @@ Statistics::draw_worldmap_info(DrawingContext& context) // draw other small info + int alpha; + if(timer.get_gone() < FADING_TIME) + alpha = timer.get_gone() * 255 / FADING_TIME; + else if(timer.get_left() < FADING_TIME) + alpha = timer.get_left() * 255 / FADING_TIME; + else + alpha = 255; + + context.push_transform(); + context.set_alpha(alpha); + if(display_stat == COINS_COLLECTED_STAT) sprintf(str, _("Max coins collected:")); else if(display_stat == BADGUYS_KILLED_STAT) @@ -137,7 +140,7 @@ Statistics::draw_worldmap_info(DrawingContext& context) else// if(display_stat == TIME_NEEDED_STAT) sprintf(str, _("Min time needed:")); - context.draw_text(white_small_text, str, Vector(WMAP_INFO_LEFT_X, 508), LEFT_ALLIGN, LAYER_GUI, NONE_EFFECT, alpha); + context.draw_text(white_small_text, str, Vector(WMAP_INFO_LEFT_X, 508), LEFT_ALLIGN, LAYER_GUI); if(display_stat == COINS_COLLECTED_STAT) sprintf(str, "%d/%d", stats[COINS_COLLECTED_STAT][SPLAYER], @@ -149,7 +152,9 @@ Statistics::draw_worldmap_info(DrawingContext& context) sprintf(str, "%d/%d", stats[TIME_NEEDED_STAT][SPLAYER], stats[TIME_NEEDED_STAT][STOTAL]); - context.draw_text(white_small_text, str, Vector(WMAP_INFO_RIGHT_X, 508), RIGHT_ALLIGN, LAYER_GUI, NONE_EFFECT, alpha); + context.draw_text(white_small_text, str, Vector(WMAP_INFO_RIGHT_X, 508), RIGHT_ALLIGN, LAYER_GUI); + + context.pop_transform(); } void