[Super-tux-commit] supertux/src leveleditor.cpp,1.153,1.154
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-10-08 21:59:52
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19162/src Modified Files: leveleditor.cpp Log Message: Fading level's name text. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.153 retrieving revision 1.154 diff -u -d -r1.153 -r1.154 --- leveleditor.cpp 8 Oct 2004 12:19:05 -0000 1.153 +++ leveleditor.cpp 8 Oct 2004 21:59:25 -0000 1.154 @@ -545,6 +545,8 @@ } } +#define FADING_TIME 600 + void LevelEditor::draw(DrawingContext& context) { context.draw_text(white_text, _("Level Editor"), Vector(10, 5), LEFT_ALLIGN, LAYER_GUI); @@ -555,6 +557,12 @@ if(level_name_timer.check()) { + if(level_name_timer.get_left() < FADING_TIME) + { + context.push_transform(); + context.set_alpha(level_name_timer.get_left() * 255 / FADING_TIME); + } + context.draw_text(gold_text, level.name, Vector(screen->w/2, 30), CENTER_ALLIGN, LAYER_GUI); if(level_nb != -1) { @@ -562,6 +570,9 @@ sprintf(str, "%i/%i", level_nb+1, level_subset.get_num_levels()); context.draw_text(gold_text, str, Vector(screen->w/2, 50), CENTER_ALLIGN, LAYER_GUI); } + + if(level_name_timer.get_left() < FADING_TIME) + context.pop_transform(); } if(sector) context.draw_text(white_small_text, _("F1 for help"), Vector(5, 510), LEFT_ALLIGN, LAYER_GUI-10); |