From 3b815a900a2ada8aeeb288e3905bf5dc429e19b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 4 Nov 2014 15:53:08 +0100 Subject: Button: add public blocked --- core/src/ch/asynk/tankontank/game/hud/Button.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- cgit v1.1-2-g2b99