diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-08 06:22:53 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-08 06:22:53 +0100 |
commit | d67c6f267073265fba09c91a6e10e55138de91e8 (patch) | |
tree | 597daca148354166955edf0dc95007ae8ba71d01 /core/src/ch/asynk/rustanddust/ui | |
parent | 7648047a45a4df146094540709daa46fff90d29d (diff) | |
download | RustAndDust-d67c6f267073265fba09c91a6e10e55138de91e8.zip RustAndDust-d67c6f267073265fba09c91a6e10e55138de91e8.tar.gz |
ui/Menu: implement boolean hit(int, int)
Diffstat (limited to 'core/src/ch/asynk/rustanddust/ui')
-rw-r--r-- | core/src/ch/asynk/rustanddust/ui/Menu.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/ui/Menu.java b/core/src/ch/asynk/rustanddust/ui/Menu.java index 78f5964..0ffc5f1 100644 --- a/core/src/ch/asynk/rustanddust/ui/Menu.java +++ b/core/src/ch/asynk/rustanddust/ui/Menu.java @@ -87,6 +87,18 @@ public class Menu extends Patch } @Override + public boolean hit(float x, float y) + { + for (int i = 0; i< menuItem.last(); i ++) { + if (labels[i].hit(x, y)) { + menuItem = menuItem.get(i); + return true; + } + } + return false; + } + + @Override public void draw(Batch batch) { if (!visible) return; |