diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-17 16:11:02 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-17 16:11:02 +0100 |
commit | 322999007c89ede0f9a824cac1ec35ef8b9b3765 (patch) | |
tree | 956b33b0f1bf57f3a0f701c952030be098f41986 /core/src/ch | |
parent | 437cba871f426faabfffdad090653687894fcead (diff) | |
download | RustAndDust-322999007c89ede0f9a824cac1ec35ef8b9b3765.zip RustAndDust-322999007c89ede0f9a824cac1ec35ef8b9b3765.tar.gz |
OkCancel: add updatePosition()
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/OkCancel.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/hud/OkCancel.java b/core/src/ch/asynk/tankontank/game/hud/OkCancel.java index 084e868..0ea04c3 100644 --- a/core/src/ch/asynk/tankontank/game/hud/OkCancel.java +++ b/core/src/ch/asynk/tankontank/game/hud/OkCancel.java @@ -34,6 +34,17 @@ public class OkCancel extends Patch this.visible = false; } + 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); + label.translate(dx, dy); + okBtn.translate(dx, dy); + cancelBtn.translate(dx, dy); + } + public void show(String msg, Action action) { show(msg, action, Position.MIDDLE_CENTER); |