- context.draw_filled_rect(
- Vector(pos_x - menu_width/2, pos_y - 24*items.size()/2 - 10),
- Vector(menu_width,menu_height + 20),
- Color(0.6f, 0.7f, 0.8f, 0.5f), LAYER_GUI-10);
+ context.draw_filled_rect(Rect(Vector(pos_x - menu_width/2-4, pos_y - menu_height/2 - 10-4),
+ Vector(pos_x + menu_width/2+4, pos_y - menu_height/2 + 10 + menu_height+4)),
+ Color(0.2f, 0.3f, 0.4f, 0.8f),
+ 20.0f,
+ LAYER_GUI-10);
+
+ context.draw_filled_rect(Rect(Vector(pos_x - menu_width/2, pos_y - menu_height/2 - 10),
+ Vector(pos_x + menu_width/2, pos_y - menu_height/2 + 10 + menu_height)),
+ Color(0.6f, 0.7f, 0.8f, 0.5f),
+ 16.0f,
+ LAYER_GUI-10);
+
+ if (!items[active_item]->help.empty())
+ {
+ int text_width = (int) normal_font->get_text_width(items[active_item]->help);
+ int text_height = (int) normal_font->get_text_height(items[active_item]->help);
+
+ Rect text_rect(pos_x - text_width/2 - 8,
+ SCREEN_HEIGHT - 48 - text_height/2 - 4,
+ pos_x + text_width/2 + 8,
+ SCREEN_HEIGHT - 48 + text_height/2 + 4);
+
+ context.draw_filled_rect(Rect(text_rect.p1 - Vector(4,4),
+ text_rect.p2 + Vector(4,4)),
+ Color(0.2f, 0.3f, 0.4f, 0.8f),
+ 16.0f,
+ LAYER_GUI-10);
+
+ context.draw_filled_rect(text_rect,
+ Color(0.6f, 0.7f, 0.8f, 0.5f),
+ 16.0f,
+ LAYER_GUI-10);
+
+ context.draw_text(normal_font, items[active_item]->help,
+ Vector(pos_x, SCREEN_HEIGHT - 48 - text_height/2),
+ ALIGN_CENTER, LAYER_GUI);
+ }