diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-07 23:20:02 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-07 23:20:02 +0200 |
commit | 9ec2a47c29300a7db60d778bc737baf7fe17f692 (patch) | |
tree | 1382f2843f456cf8de0d1d064c9fb698c96bdd1e /core | |
parent | 67b902f5b1fae988b3d22d1379b14650b7124520 (diff) | |
download | RustAndDust-9ec2a47c29300a7db60d778bc737baf7fe17f692.zip RustAndDust-9ec2a47c29300a7db60d778bc737baf7fe17f692.tar.gz |
Hud: add checkBtn and enableCheck()
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 46fdb47..02e7211 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -96,6 +96,7 @@ public class Hud implements Disposable private Button moveBtn; private Button rotateBtn; private Button attackBtn; + private Button checkBtn; private Button cancelBtn; private Rectangle rect; @@ -113,6 +114,7 @@ public class Hud implements Disposable moveBtn = new Button(atlas, "btn-move"); rotateBtn = new Button(atlas, "btn-rotate"); attackBtn = new Button(atlas, "btn-attack"); + checkBtn = new Button(atlas, "btn-check"); cancelBtn = new Button(atlas, "btn-cancel"); flag = usFlag; @@ -123,8 +125,10 @@ public class Hud implements Disposable moveBtn.setPosition((left - moveBtn.getWidth()), ( flag.getY() - moveBtn.getHeight() - 5)); rotateBtn.setPosition((left - rotateBtn.getWidth()), ( moveBtn.getY() - rotateBtn.getHeight() - 5)); attackBtn.setPosition((left - attackBtn.getWidth()), ( rotateBtn.getY() - attackBtn.getHeight() - 5)); - cancelBtn.setPosition((left - cancelBtn.getWidth()), ( attackBtn.getY() - cancelBtn.getHeight() - 5)); + checkBtn.setPosition((left - checkBtn.getWidth()), ( attackBtn.getY() - checkBtn.getHeight() - 5)); + cancelBtn.setPosition((left - cancelBtn.getWidth()), ( checkBtn.getY() - cancelBtn.getHeight() - 5)); cancelBtn.disable(); + checkBtn.disable(); rect = new Rectangle(cancelBtn.getX(), cancelBtn.getY(), flag.getWidth(), (flag.getY() + flag.getHeight() - cancelBtn.getY())); @@ -140,6 +144,7 @@ public class Hud implements Disposable moveBtn.dispose(); rotateBtn.dispose(); attackBtn.dispose(); + checkBtn.dispose(); cancelBtn.dispose(); } @@ -158,6 +163,7 @@ public class Hud implements Disposable moveBtn.getImage().draw(batch); rotateBtn.getImage().draw(batch); attackBtn.getImage().draw(batch); + checkBtn.getImage().draw(batch); cancelBtn.getImage().draw(batch); } @@ -166,6 +172,7 @@ public class Hud implements Disposable moveBtn.setOff(); rotateBtn.setOff(); attackBtn.setOff(); + checkBtn.disable(); cancelBtn.disable(); } @@ -174,6 +181,11 @@ public class Hud implements Disposable cancelBtn.disable(); } + public void enableCheck() + { + cancelBtn.setOff(); + } + public boolean touchDown(float x, float y) { if (!rect.contains(x,y)) return false; |