Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LMH0013 committed Sep 3, 2013
1 parent f8e7c8b commit 57a274d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions src/supertux/statistics.cpp
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/worldmap/worldmap.cpp
Expand Up @@ -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
/*
Expand Down

0 comments on commit 57a274d

Please sign in to comment.