summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/ActionButtons.java7
2 files changed, 7 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java
index 8b96696..5aa8075 100644
--- a/core/src/ch/asynk/tankontank/game/Hud.java
+++ b/core/src/ch/asynk/tankontank/game/Hud.java
@@ -84,7 +84,7 @@ public class Hud implements Disposable, Animation
{
Position position = ctrl.battle.getHudPosition(ctrl.player);
playerInfo.update(ctrl.player, position);
- actionButtons.setPosition(position.horizontalMirror());
+ actionButtons.update(position.horizontalMirror());
}
@Override
diff --git a/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java b/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java
index 17402f0..a2dcf12 100644
--- a/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java
+++ b/core/src/ch/asynk/tankontank/game/hud/ActionButtons.java
@@ -38,7 +38,6 @@ public class ActionButtons extends Widget
private int idx;
private Bg buttons [];
private StateType states [];
- private Position position;
public ActionButtons(Ctrl ctrl, TextureAtlas uiAtlas, TextureAtlas hudAtlas)
{
@@ -67,6 +66,12 @@ public class ActionButtons extends Widget
buttons[i].dispose();
}
+ public void update(Position position)
+ {
+ setPosition(position);
+ updatePosition();
+ }
+
public void updatePosition()
{
if (!visible) return;