summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-21 13:46:36 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-21 13:46:36 +0100
commit2b530a4585c2eb580d8c46ebbc77669be4059b1b (patch)
treec9a7819f6bf3f930ba25ac72ec553c9ff400362e
parent60e00dc82bbe9899648f252e41fe0389bf13f309 (diff)
downloadRustAndDust-2b530a4585c2eb580d8c46ebbc77669be4059b1b.zip
RustAndDust-2b530a4585c2eb580d8c46ebbc77669be4059b1b.tar.gz
RustAndDust: load and use only black font
-rw-r--r--core/src/ch/asynk/rustanddust/RustAndDust.java10
-rw-r--r--core/src/ch/asynk/rustanddust/game/Hud.java12
-rw-r--r--core/src/ch/asynk/rustanddust/screens/MenuScreen.java8
3 files changed, 13 insertions, 17 deletions
diff --git a/core/src/ch/asynk/rustanddust/RustAndDust.java b/core/src/ch/asynk/rustanddust/RustAndDust.java
index 29a5c69..f6f0c22 100644
--- a/core/src/ch/asynk/rustanddust/RustAndDust.java
+++ b/core/src/ch/asynk/rustanddust/RustAndDust.java
@@ -28,8 +28,7 @@ public class RustAndDust extends Game
public TextureAtlas uiAtlas;
public TextureAtlas menuAtlas;
- public BitmapFont fontB;
- public BitmapFont fontW;
+ public BitmapFont font;
public enum State
{
@@ -161,15 +160,12 @@ public class RustAndDust extends Game
Bg.setScale(Math.max((h * 0.00125f), 1.0f));
parameter.size = Math.max((int) (h * 0.04f), 16);
parameter.color = Color.BLACK;
- fontB = generator.generateFont(parameter);
- parameter.color = Color.WHITE;
- fontW = generator.generateFont(parameter);
+ font = generator.generateFont(parameter);
}
private void unloadUiAssets()
{
- fontB.dispose();
- fontW.dispose();
+ font.dispose();
manager.unload("data/ui.atlas");
}
diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java
index 661d4e9..8dae202 100644
--- a/core/src/ch/asynk/rustanddust/game/Hud.java
+++ b/core/src/ch/asynk/rustanddust/game/Hud.java
@@ -58,13 +58,13 @@ public class Hud implements Disposable, Animation
this.ctrl = ctrl;
TextureAtlas hudAtlas = game.factory.hudAtlas;
- playerInfo = new PlayerInfo(ctrl, game.fontW, game.uiAtlas, hudAtlas);
+ playerInfo = new PlayerInfo(ctrl, game.font, game.uiAtlas, hudAtlas);
actionButtons = new ActionButtons(ctrl, game.uiAtlas, hudAtlas);
actionButtons.hide();
- msg = new Msg(game.fontB, game.uiAtlas);
- okCancel = new OkCancel(game.fontB, game.uiAtlas);
- stats = new StatisticsPanel(game.fontB, game.uiAtlas);
- engagement = new EngagementPanel(game.fontB, game.uiAtlas, hudAtlas);
+ msg = new Msg(game.font, game.uiAtlas);
+ okCancel = new OkCancel(game.font, game.uiAtlas);
+ stats = new StatisticsPanel(game.font, game.uiAtlas);
+ engagement = new EngagementPanel(game.font, game.uiAtlas, hudAtlas);
}
@Override
@@ -109,7 +109,7 @@ public class Hud implements Disposable, Animation
{
draw(batch);
if (debug)
- game.fontB.draw(batch, String.format("FPS: %d", Gdx.graphics.getFramesPerSecond()), 80, 25);
+ game.font.draw(batch, String.format("FPS: %d", Gdx.graphics.getFramesPerSecond()), 80, 25);
}
@Override
diff --git a/core/src/ch/asynk/rustanddust/screens/MenuScreen.java b/core/src/ch/asynk/rustanddust/screens/MenuScreen.java
index f00f2e9..8997eb4 100644
--- a/core/src/ch/asynk/rustanddust/screens/MenuScreen.java
+++ b/core/src/ch/asynk/rustanddust/screens/MenuScreen.java
@@ -77,10 +77,10 @@ public class MenuScreen implements Screen
this.usFlag = new Sprite(game.menuAtlas.findRegion("us-flag"));
this.geFlag = new Sprite(game.menuAtlas.findRegion("ge-flag"));
- this.mainMenu = new MainMenu(game.fontB, game.uiAtlas);
- this.playMenu = new PlayMenu(game, game.fontB, game.uiAtlas);
- this.optionsMenu = new OptionsMenu(game, game.fontB, game.uiAtlas);
- this.tutorialsMenu = new TutorialsMenu(game, game.fontB, game.uiAtlas);
+ this.mainMenu = new MainMenu(game.font, game.uiAtlas);
+ this.playMenu = new PlayMenu(game, game.font, game.uiAtlas);
+ this.optionsMenu = new OptionsMenu(game, game.font, game.uiAtlas);
+ this.tutorialsMenu = new TutorialsMenu(game, game.font, game.uiAtlas);
Gdx.input.setInputProcessor(new InputAdapter() {
@Override