From: Ingo Ruhnke Date: Mon, 5 May 2008 11:40:07 +0000 (+0000) Subject: Added some blinking to the current menu item X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=54bbe061559a31d340a7f54cef576a76a5051466;p=supertux.git Added some blinking to the current menu item SVN-Revision: 5403 --- diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp index e67d906d6..afa371ec7 100644 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -538,9 +539,10 @@ Menu::draw_item(DrawingContext& context, int index) if(active_item == index) { + float blink = (sinf(real_time * M_PI * 1.0f)/2.0f + 0.5f) * 0.5f + 0.25f; context.draw_filled_rect(Rect(Vector(pos_x - menu_width/2 + 10 - 2, y_pos - 12 - 2), Vector(pos_x + menu_width/2 - 10 + 2, y_pos + 12 + 2)), - Color(1.0f, 1.0f, 1.0f, 0.5f), + Color(1.0f, 1.0f, 1.0f, blink), 14.0f, LAYER_GUI-10); context.draw_filled_rect(Rect(Vector(pos_x - menu_width/2 + 10, y_pos - 12),