From: LMH Date: Tue, 3 Sep 2013 22:46:04 +0000 (-1000) Subject: Tweaked worldmap HUD. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=10f61ac7431a50d9474f16c40d036fe8b2b6e28c;p=supertux.git Tweaked worldmap HUD. 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. --- diff --git a/src/supertux/statistics.cpp b/src/supertux/statistics.cpp index 95ad4edb6..da9ffb157 100644 --- a/src/supertux/statistics.cpp +++ b/src/supertux/statistics.cpp @@ -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); diff --git a/src/worldmap/worldmap.cpp b/src/worldmap/worldmap.cpp index 3d608d532..e082d8f2b 100644 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@ -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 /*