diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-20 09:23:13 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-20 09:23:13 +0100 |
commit | a838f68aa71ce6d308835147e34df788a7d8aeb9 (patch) | |
tree | 8450647c9e601647a2c7aebc72e810b670231a52 /core/src/ch | |
parent | 54d0e844adf1130ac3719a254a6dbcf157cd5644 (diff) | |
download | RustAndDust-a838f68aa71ce6d308835147e34df788a7d8aeb9.zip RustAndDust-a838f68aa71ce6d308835147e34df788a7d8aeb9.tar.gz |
ActionButtons: fix position update
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/ActionButtons.java | 7 |
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; |