From e76057bd13309744d752ff69d7a57f31165b5555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 10 Dec 2014 16:45:27 +0100 Subject: Hud: load font black and white --- core/src/ch/asynk/tankontank/game/Hud.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 42725cd..885b98e 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -33,7 +33,8 @@ public class Hud implements Disposable, Animation private final Ctrl ctrl; private Object hit; - private BitmapFont font; + private BitmapFont fontB; + private BitmapFont fontW; public PlayerInfo playerInfo; public ActionButtons actionButtons; @@ -50,20 +51,22 @@ public class Hud implements Disposable, Animation this.ctrl = ctrl; TextureAtlas atlas = game.factory.hudAtlas; - font = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), atlas.findRegion("veteran-white")); - playerInfo = new PlayerInfo(ctrl, font, atlas, 5f); + fontB = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), atlas.findRegion("veteran-black")); + fontW = new BitmapFont(Gdx.files.internal("skin/veteran.fnt"), atlas.findRegion("veteran-white")); + playerInfo = new PlayerInfo(ctrl, fontW, atlas, 5f); actionButtons = new ActionButtons(ctrl, atlas, 5f); actionButtons.hide(); - msg = new Msg(font, atlas, 10f); - okCancel = new OkCancel(font, atlas, 10f); - stats = new Statistics(font, atlas, 10f); - engagement = new Engagement(font, atlas); + msg = new Msg(fontW, atlas, 10f); + okCancel = new OkCancel(fontW, atlas, 10f); + stats = new Statistics(fontW, atlas, 10f); + engagement = new Engagement(fontB, atlas); } @Override public void dispose() { - font.dispose(); + fontB.dispose(); + fontW.dispose(); playerInfo.dispose(); actionButtons.dispose(); msg.dispose(); @@ -92,7 +95,7 @@ public class Hud implements Disposable, Animation { draw(batch); if (debug) - font.draw(batch, String.format("FPS: %d", Gdx.graphics.getFramesPerSecond()), 80, 25); + fontB.draw(batch, String.format("FPS: %d", Gdx.graphics.getFramesPerSecond()), 80, 25); } @Override -- cgit v1.1-2-g2b99