summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-09 23:37:09 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-09 23:37:09 +0100
commitfdf816a560b0359e7771de1333887ca0ec70fa24 (patch)
tree9e3843a4d75750f606708474e04038d6e3226aa1 /core/src/ch/asynk/tankontank
parent9dcc8e25fb9fafbe5ff3bcb5dc0b35f723771bc5 (diff)
downloadRustAndDust-fdf816a560b0359e7771de1333887ca0ec70fa24.zip
RustAndDust-fdf816a560b0359e7771de1333887ca0ec70fa24.tar.gz
GameScreen,Hud: hud draw FPS on DEBUG
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java7
-rw-r--r--core/src/ch/asynk/tankontank/screens/GameScreen.java4
2 files changed, 8 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java
index 03ef812..06ccfde 100644
--- a/core/src/ch/asynk/tankontank/game/Hud.java
+++ b/core/src/ch/asynk/tankontank/game/Hud.java
@@ -88,6 +88,13 @@ public class Hud implements Disposable, Animation
return false;
}
+ public void draw(Batch batch, boolean debug)
+ {
+ draw(batch);
+ if (debug)
+ font.draw(batch, String.format("FPS: %d", Gdx.graphics.getFramesPerSecond()), 80, 25);
+ }
+
@Override
public void draw(Batch batch)
{
diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java
index aa844c8..8d7a8b3 100644
--- a/core/src/ch/asynk/tankontank/screens/GameScreen.java
+++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java
@@ -208,9 +208,7 @@ public class GameScreen implements Screen
hudCam.update();
hudBatch.setProjectionMatrix(hudCam.combined);
hudBatch.begin();
- ctrl.hud.draw(hudBatch);
- if (DEBUG)
- game.skin.getFont("default-font").draw(hudBatch, String.format("FPS: %d", Gdx.graphics.getFramesPerSecond()), 80, 25);
+ ctrl.hud.draw(hudBatch, DEBUG);
hudBatch.end();
if (DEBUG) {