- char str[60];
-
- if(time_left.get_timeleft() < 0) {
- context.draw_text(white_text, _("TIME's UP"), Vector(SCREEN_WIDTH/2, 0),
- CENTER_ALLIGN, LAYER_FOREGROUND1);
- } else if (time_left.get_timeleft() > TIME_WARNING
- || int(global_time * 2.5) % 2) {
- snprintf(str, sizeof(str), " %d", int(time_left.get_timeleft()));
- context.draw_text(white_text, _("TIME"),
- Vector(SCREEN_WIDTH/2, 0), CENTER_ALLIGN, LAYER_FOREGROUND1);
- context.draw_text(gold_text, str, Vector(SCREEN_WIDTH/2 + 4*16, 0),
- CENTER_ALLIGN, LAYER_FOREGROUND1);
+ if ((time_left > TIME_WARNING) || (int(game_time * 2.5) % 2)) {
+ std::stringstream ss;
+ ss << int(time_left);
+ std::string time_text = ss.str();
+
+ Surface* time_surf = time_surface.get();
+ if (time_surf) {
+ float all_width = time_surf->get_width() + normal_font->get_text_width(time_text);
+ context.draw_surface(time_surf, Vector((SCREEN_WIDTH - all_width)/2, BORDER_Y + 1), LAYER_FOREGROUND1);
+ context.draw_text(normal_font, time_text, Vector((SCREEN_WIDTH - all_width)/2 + time_surf->get_width(), BORDER_Y), ALIGN_LEFT, LAYER_FOREGROUND1, LevelTime::text_color);
+ }