From: Wolfgang Becker Date: Tue, 30 Jan 2007 22:16:39 +0000 (+0000) Subject: Use fixed with font for coin counter to make it less jumpy. X-Git-Url: https://git.octo.it/?p=supertux.git;a=commitdiff_plain;h=f955a4262c3924e14c97025f463252e7f1ca7a03 Use fixed with font for coin counter to make it less jumpy. SVN-Revision: 4750 --- diff --git a/src/player_status.cpp b/src/player_status.cpp index a5fcf1e3d..352fac3d5 100644 --- a/src/player_status.cpp +++ b/src/player_status.cpp @@ -153,9 +153,9 @@ PlayerStatus::draw(DrawingContext& context) Surface* coin_surf = coin_surface.get(); if (coin_surf) { - context.draw_surface(coin_surf, Vector(SCREEN_WIDTH - BORDER_X - coin_surf->get_width() - gold_text->get_text_width(coins_text), BORDER_Y + 1), LAYER_HUD); + context.draw_surface(coin_surf, Vector(SCREEN_WIDTH - BORDER_X - coin_surf->get_width() - gold_fixed_text->get_text_width(coins_text), BORDER_Y + 1), LAYER_HUD); } - context.draw_text(gold_text, coins_text, Vector(SCREEN_WIDTH - BORDER_X, BORDER_Y), ALIGN_RIGHT, LAYER_HUD); + context.draw_text(gold_fixed_text, coins_text, Vector(SCREEN_WIDTH - BORDER_X, BORDER_Y), ALIGN_RIGHT, LAYER_HUD); context.pop_transform(); } diff --git a/src/resources.cpp b/src/resources.cpp index 3931b2e0e..5dee002de 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -31,6 +31,7 @@ MouseCursor* mouse_cursor = NULL; Font* gold_text = NULL; +Font* gold_fixed_text = NULL; Font* blue_text = NULL; Font* gray_text = NULL; Font* white_text = NULL; @@ -48,6 +49,9 @@ void load_shared() gold_text = new Font(Font::VARIABLE, "images/engine/fonts/gold.png", "images/engine/fonts/shadow.png", 16, 18); + gold_fixed_text = new Font(Font::FIXED, + "images/engine/fonts/gold.png", + "images/engine/fonts/shadow.png", 16, 18); blue_text = new Font(Font::VARIABLE, "images/engine/fonts/blue.png", "images/engine/fonts/shadow.png", 16, 18, 3); diff --git a/src/resources.hpp b/src/resources.hpp index 2ee485b2f..27d1e9894 100644 --- a/src/resources.hpp +++ b/src/resources.hpp @@ -26,6 +26,7 @@ class MouseCursor; extern MouseCursor* mouse_cursor; extern Font* gold_text; +extern Font* gold_fixed_text; extern Font* white_text; extern Font* blue_text; extern Font* gray_text;