summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-02 12:27:17 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-02 12:27:17 +0100
commit1d1532c46489d201d81011dcf5639057814294b2 (patch)
tree9dd0a3219ca96ca57f4519d90afb712eb9df6b1d
parent207831991cbb92778b2cea586634d66a769bddfa (diff)
downloadRustAndDust-1d1532c46489d201d81011dcf5639057814294b2.zip
RustAndDust-1d1532c46489d201d81011dcf5639057814294b2.tar.gz
Hud: replace Msg status with Image aps and Text apsText
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java
index c8ab144..5a8ffc3 100644
--- a/core/src/ch/asynk/tankontank/game/Hud.java
+++ b/core/src/ch/asynk/tankontank/game/Hud.java
@@ -13,6 +13,7 @@ import ch.asynk.tankontank.engine.gfx.Image;
import ch.asynk.tankontank.game.hud.Bg;
import ch.asynk.tankontank.game.hud.Button;
import ch.asynk.tankontank.game.hud.Msg;
+import ch.asynk.tankontank.game.hud.Text;
import ch.asynk.tankontank.game.hud.Position;
import ch.asynk.tankontank.TankOnTank;
@@ -39,7 +40,8 @@ public class Hud implements Disposable
private Image flag;
private Image usFlag;
private Image geFlag;
- private Msg status;
+ private Image aps;
+ private Text apsText;
private Image reinforcement;
@@ -65,20 +67,22 @@ public class Hud implements Disposable
usFlag = new Image(atlas.findRegion("us-flag"));
geFlag = new Image(atlas.findRegion("ge-flag"));
- status = new Msg(game.skin.getFont("default-font"), atlas.findRegion("disabled"));
+ aps = new Image(atlas.findRegion("aps"));
+ apsText = new Text(game.skin.getFont("default-font"), "0");
reinforcement= new Image(atlas.findRegion("reinforcement"));
float x = OFFSET;
float y = (Gdx.graphics.getHeight() - OFFSET);
usFlag.setPosition(x, (y - usFlag.getHeight()));
geFlag.setPosition(x, (y - geFlag.getHeight()));
- status.setTopLeft((x + usFlag.getWidth() + 10), y, 10);
+ aps.setPosition((usFlag.getX() + usFlag.getWidth() + 10), usFlag.getY());
+ apsText.setPosition((aps.getX() + aps.getWidth() - 15), (aps.getY() + aps.getHeight() - 20));
reinforcement.setPosition(x, usFlag.getY() - reinforcement.getHeight() - 0);
}
public void update()
{
- status.write(ctrl.player.getStatus(), 0);
+ apsText.write("" + ctrl.player.getAp());
if (ctrl.player.getFaction() == Army.GE)
flag = geFlag;
else
@@ -98,9 +102,10 @@ public class Hud implements Disposable
actionsBg.dispose();
msg.dispose();
+ aps.dispose();
+ apsText.dispose();
usFlag.dispose();
geFlag.dispose();
- status.dispose();
reinforcement.dispose();
}
@@ -112,7 +117,8 @@ public class Hud implements Disposable
public void draw(Batch batch)
{
flag.draw(batch);
- status.draw(batch);
+ aps.draw(batch);
+ apsText.draw(batch);
reinforcement.draw(batch);
actionsBg.draw(batch);