summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-17 16:12:20 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-17 16:12:20 +0100
commitde4d543e48341118386f52012dd8bcdbc62c5757 (patch)
treef886162423ccee038f96eb5c2f78e44d3a344b18
parent322999007c89ede0f9a824cac1ec35ef8b9b3765 (diff)
downloadRustAndDust-de4d543e48341118386f52012dd8bcdbc62c5757.zip
RustAndDust-de4d543e48341118386f52012dd8bcdbc62c5757.tar.gz
Statistics: add updatePosition()
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/Statistics.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/hud/Statistics.java b/core/src/ch/asynk/tankontank/game/hud/Statistics.java
index 51eef6f..6a91161 100644
--- a/core/src/ch/asynk/tankontank/game/hud/Statistics.java
+++ b/core/src/ch/asynk/tankontank/game/hud/Statistics.java
@@ -32,6 +32,19 @@ public class Statistics extends Patch
this.header.write("\nActions\nUnits Left\nCasualties\nWon Attacks\nLost Attacks");
}
+ public void updatePosition()
+ {
+ if (!visible) return;
+ float dx = (position.getX(rect.width) - rect.x);
+ float dy = (position.getY(rect.height) - rect.y);
+ translate(dx, dy);
+ title.translate(dx, dy);
+ header.translate(dx, dy);
+ stats1.translate(dx, dy);
+ stats2.translate(dx, dy);
+ okBtn.translate(dx, dy);
+ }
+
public void show(Player winner, Player loser, Position position)
{
title.write(winner.getName() + " player won the battle in " + winner.getTurnDone() + " turns.");