summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-02-08 06:22:53 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-02-08 06:22:53 +0100
commitd67c6f267073265fba09c91a6e10e55138de91e8 (patch)
tree597daca148354166955edf0dc95007ae8ba71d01 /core/src/ch
parent7648047a45a4df146094540709daa46fff90d29d (diff)
downloadRustAndDust-d67c6f267073265fba09c91a6e10e55138de91e8.zip
RustAndDust-d67c6f267073265fba09c91a6e10e55138de91e8.tar.gz
ui/Menu: implement boolean hit(int, int)
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/rustanddust/ui/Menu.java12
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;