diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-04 15:53:08 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-04 15:53:08 +0100 |
commit | 3b815a900a2ada8aeeb288e3905bf5dc429e19b8 (patch) | |
tree | 3dd684e832ef99ceb6e0e8f1a3b85ad1b55e8c83 /core/src/ch/asynk/tankontank/game/hud | |
parent | 74fd1fc62bc3b617e8890ad8f27a53422eee1f74 (diff) | |
download | RustAndDust-3b815a900a2ada8aeeb288e3905bf5dc429e19b8.zip RustAndDust-3b815a900a2ada8aeeb288e3905bf5dc429e19b8.tar.gz |
Button: add public blocked
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/hud')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/Button.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/hud/Button.java b/core/src/ch/asynk/tankontank/game/hud/Button.java index 2d344b4..4ce1120 100644 --- a/core/src/ch/asynk/tankontank/game/hud/Button.java +++ b/core/src/ch/asynk/tankontank/game/hud/Button.java @@ -14,6 +14,7 @@ public class Button implements Disposable { public int idx; + public boolean blocked; public boolean visible; private Image images []; private Image image; @@ -26,6 +27,7 @@ public class Button implements Disposable public Button(TextureAtlas atlas, String base) { this.idx = OFF; + this.blocked = false; this.visible = false; this.images = new Image[3]; this.images[OFF] = new Image(atlas.findRegion(base + "-off")); @@ -92,7 +94,7 @@ public class Button implements Disposable public boolean hit(float x, float y) { - if (!visible || (idx == ON)) return false; + if (blocked || !visible || (idx == ON)) return false; return rect.contains(x,y); } |