projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d830e46
)
Added some blinking to the current menu item
author
Ingo Ruhnke
<grumbel@gmx.de>
Mon, 5 May 2008 11:40:07 +0000
(11:40 +0000)
committer
Ingo Ruhnke
<grumbel@gmx.de>
Mon, 5 May 2008 11:40:07 +0000
(11:40 +0000)
SVN-Revision: 5403
src/gui/menu.cpp
patch
|
blob
|
history
diff --git
a/src/gui/menu.cpp
b/src/gui/menu.cpp
index
e67d906
..
afa371e
100644
(file)
--- a/
src/gui/menu.cpp
+++ b/
src/gui/menu.cpp
@@
-24,6
+24,7
@@
#include <iostream>
#include <sstream>
#include <iostream>
#include <sstream>
+#include <math.h>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <string>
@@
-538,9
+539,10
@@
Menu::draw_item(DrawingContext& context, int index)
if(active_item == 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)),
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),
14.0f,
LAYER_GUI-10);
context.draw_filled_rect(Rect(Vector(pos_x - menu_width/2 + 10, y_pos - 12),