Tweaked worldmap HUD.
authorLMH <lmh.0013@gmail.com>
Tue, 3 Sep 2013 22:46:04 +0000 (12:46 -1000)
committerLMH <lmh.0013@gmail.com>
Tue, 3 Sep 2013 22:46:04 +0000 (12:46 -1000)
Moved the level title text from FOREGROUND to HUD layer making it consistent with level stats text.  Changed placement of level stats from being relative to the center of the screen to being relative to the lower right corner, this should make the level stats more aesthetic across more resolution settings.

src/supertux/statistics.cpp
src/worldmap/worldmap.cpp

index 95ad4ed..da9ffb1 100644 (file)
@@ -49,10 +49,10 @@ Statistics::Statistics() :
   total_secrets(nv_secrets), 
   valid(true) 
 {
-  WMAP_INFO_LEFT_X = (SCREEN_WIDTH/2 + 80) + 32;
-  WMAP_INFO_RIGHT_X = SCREEN_WIDTH/2 + 368;
-  WMAP_INFO_TOP_Y1 = SCREEN_HEIGHT/2 + 172 - 16;
-  WMAP_INFO_TOP_Y2 = SCREEN_HEIGHT/2 + 172;
+  WMAP_INFO_LEFT_X = SCREEN_WIDTH - 32 - 256;
+  WMAP_INFO_RIGHT_X = WMAP_INFO_LEFT_X + 256;
+  WMAP_INFO_TOP_Y1 = SCREEN_HEIGHT - 100;
+  WMAP_INFO_TOP_Y2 = WMAP_INFO_TOP_Y1 + 16;
 }
 
 Statistics::~Statistics()
@@ -103,6 +103,14 @@ Statistics::draw_worldmap_info(DrawingContext& context)
   // skip draw if stats were declared invalid
   if (!valid) return;
 
+  // check to see if screen size has been changed
+  if (!(WMAP_INFO_TOP_Y1 == SCREEN_HEIGHT - 100)) {
+    WMAP_INFO_LEFT_X = SCREEN_WIDTH - 32 - 256;
+    WMAP_INFO_RIGHT_X = WMAP_INFO_LEFT_X + 256;
+    WMAP_INFO_TOP_Y1 = SCREEN_HEIGHT - 100;
+    WMAP_INFO_TOP_Y2 = WMAP_INFO_TOP_Y1 + 16;
+  }
+  
   context.draw_text(Resources::small_font, std::string("- ") + _("Best Level Statistics") + " -", 
                     Vector((WMAP_INFO_LEFT_X + WMAP_INFO_RIGHT_X) / 2, WMAP_INFO_TOP_Y1), 
                     ALIGN_CENTER, LAYER_HUD,Statistics::header_color);
index 3d608d5..e082d8f 100644 (file)
@@ -823,8 +823,8 @@ WorldMap::draw_status(DrawingContext& context)
 
         context.draw_text(Resources::normal_font, level->title,
                           Vector(SCREEN_WIDTH/2,
-                                 SCREEN_HEIGHT - Resources::normal_font->get_height() - 30),
-                          ALIGN_CENTER, LAYER_FOREGROUND1, WorldMap::level_title_color);
+                                 SCREEN_HEIGHT - Resources::normal_font->get_height() - 10),
+                          ALIGN_CENTER, LAYER_HUD, WorldMap::level_title_color);
 
         // if level is solved, draw level picture behind stats
         /*