- 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(!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)