diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2019-12-27 14:40:52 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2019-12-27 14:40:52 +0100 |
commit | 828816db241467c296d3559226cd5fe5494e5761 (patch) | |
tree | 32b4822bd0688e60f2093c7c9c846f4580778035 /test | |
parent | 876fb5909fdb1924f4ee8355a0e7840911c6b9a2 (diff) | |
download | gdx-boardgame-828816db241467c296d3559226cd5fe5494e5761.zip gdx-boardgame-828816db241467c296d3559226cd5fe5494e5761.tar.gz |
ui : Assembly is dead, Element swallows touch() that now returns Element
Diffstat (limited to 'test')
-rw-r--r-- | test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java | 2 | ||||
-rw-r--r-- | test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java | 4 | ||||
-rw-r--r-- | test/src/ch/asynk/gdx/boardgame/test/UiScreen.java | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java index 5357449..f609f2c 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java @@ -218,7 +218,7 @@ public class BoardScreen extends AbstractScreen { cam.unproject(x, y, boardTouch); cam.unprojectHud(x, y, hudTouch); - if (btn.touch(hudTouch.x, hudTouch.y)) { + if (btn.touch(hudTouch.x, hudTouch.y) != null) { setState(state.next()); } else { board.touch(boardTouch.x, boardTouch.y); diff --git a/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java b/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java index 23887f6..b0a312a 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/MenuScreen.java @@ -73,8 +73,10 @@ public class MenuScreen extends AbstractScreen { hudTouch.set(x, y, 0); camera.unproject(hudTouch); - if (root.touch(hudTouch.x, hudTouch.y)) { + if (root.touch(hudTouch.x, hudTouch.y) != root) { switch(menu.touched()) { + case -1: + break; case 0: app.switchToUi(); break; diff --git a/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java b/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java index e0fcaf4..bdd8b88 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java @@ -134,10 +134,8 @@ public class UiScreen extends AbstractScreen { hudTouch.set(x, y, 0); camera.unproject(hudTouch); - if (root.touch(hudTouch.x, hudTouch.y)) { - if (root.touched() == next) - setState(state.next()); - } + if (root.touch(hudTouch.x, hudTouch.y) == next) + setState(state.next()); } @Override protected void onDragged(int dx, int dy) { @@ -213,7 +211,7 @@ class MyList extends Patch scrollable.setPosition(getInnerX(), getInnerY(), getInnerWidth(), getInnerHeight() - title.getHeight() - 15); } - @Override public boolean touch(float x, float y) + @Override public Element touch(float x, float y) { return scrollable.touch(x, y); } |