- if(!info.empty())
- white_small_text->draw(info.c_str(), i + rect.x - strlen(info.c_str()) * white_small_text->w, rect.y, 1);
- sprintf(str,"(%s)", SDL_GetKeyName(shortcut));
- white_small_text->draw(str, i + rect.x - strlen(str) * white_small_text->w, rect.y + white_small_text->h+2, 1);
- }
- if(state == BUTTON_PRESSED)
+/* if(drawable)
+ {
+ Camera viewport;
+ viewport.set_translation(Vector(rect.x, rect.y));
+ drawable->draw(viewport, 0);
+ }*/
+
+ if(show_info)
+ {
+ char str[80];
+ int i = -32;
+
+ if(0 > rect.x - white_small_text->get_text_width(info))
+ i = rect.w + (int)white_small_text->get_text_width(info);
+
+ if(!info.empty())
+ context.draw_text(white_small_text, info, Vector(i + rect.x - white_small_text->get_text_width(info), rect.y), LAYER_GUI);
+ sprintf(str,"(%s)", SDL_GetKeyName(shortcut));
+ context.draw_text(white_small_text, str, Vector(i + rect.x - white_small_text->get_text_width(str), rect.y + white_small_text->get_height()+2), LAYER_GUI);
+ }
+ if(state == BUTTON_PRESSED || state == BUTTON_DEACTIVE)