summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-09-11 19:57:35 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-09-11 19:57:35 +0200
commitde8b651b8d3b8f22d8bbad1a968d2e2a2ca14f36 (patch)
treebb1ee499a001e584ba225a3ef22a5e28d917f5d0 /core/src/ch
parent9c3f62417a577618d52b7458a99413bde6f9a901 (diff)
downloadgdx-boardgame-de8b651b8d3b8f22d8bbad1a968d2e2a2ca14f36.zip
gdx-boardgame-de8b651b8d3b8f22d8bbad1a968d2e2a2ca14f36.tar.gz
Assembly : track touched Element
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/zproject/engine/ui/Assembly.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/src/ch/asynk/zproject/engine/ui/Assembly.java b/core/src/ch/asynk/zproject/engine/ui/Assembly.java
index a8f00ab..3a52acd 100644
--- a/core/src/ch/asynk/zproject/engine/ui/Assembly.java
+++ b/core/src/ch/asynk/zproject/engine/ui/Assembly.java
@@ -8,6 +8,7 @@ import ch.asynk.zproject.engine.util.IterableSet;
public abstract class Assembly extends Element
{
private IterableSet<Element> children;
+ private Element touched;
public Assembly(int c)
{
@@ -28,11 +29,19 @@ public abstract class Assembly extends Element
}
}
+ public Element touched()
+ {
+ return touched;
+ }
+
@Override public boolean touch(float x, float y)
{
for (Element e : children)
- if (e.touch(x, y))
+ if (e.touch(x, y)) {
+ touched = e;
return true;
+ }
+ touched = null;
return false;
}