diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-07-13 08:37:11 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-07-13 08:37:11 +0200 |
commit | 7c879d254a0aba68f1245740c70c2f9964ac087d (patch) | |
tree | 631b6d72145943759255b994cc2fc5384b42b036 /test/src/ch/asynk/gdx/boardgame | |
parent | 47dac95b9b0cb0606f57a5e7889deb0fe7812346 (diff) | |
download | gdx-boardgame-7c879d254a0aba68f1245740c70c2f9964ac087d.zip gdx-boardgame-7c879d254a0aba68f1245740c70c2f9964ac087d.tar.gz |
HexScreen : show touch screen coords
Diffstat (limited to 'test/src/ch/asynk/gdx/boardgame')
-rw-r--r-- | test/src/ch/asynk/gdx/boardgame/test/HexScreen.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/src/ch/asynk/gdx/boardgame/test/HexScreen.java b/test/src/ch/asynk/gdx/boardgame/test/HexScreen.java index c3d93f2..66b069f 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/HexScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/HexScreen.java @@ -319,9 +319,9 @@ public class HexScreen extends AbstractScreen unit.setRotation(o.r()); } - private void touchInfo(Tile t) + private void touchInfo(int x, int y, Tile t) { - GdxBoardTest.debug("BoardScreen", String.format("touchDown [%d;%d] => %s[%d]", t.x, t.y, t, board.genKey(t.x, t.y))); + GdxBoardTest.debug("BoardScreen", String.format("touchDown [%d;%d] => [%d;%d] => %s[%d]", x, y, t.x, t.y, t, board.genKey(t.x, t.y))); } public boolean touch(float x, float y, boolean down) @@ -336,12 +336,14 @@ public class HexScreen extends AbstractScreen } else if (!engineer.dragging && engineer.isOn(tile)) { engineer.dragging = true; } else { - touchInfo(tile); + touchInfo((int)x, (int)y, tile); } } else { if (panzer.dragging) { + touchInfo((int)x, (int)y, tile); update(tile, panzer); } else if (engineer.dragging) { + touchInfo((int)x, (int)y, tile); update(tile, engineer); } } @@ -350,7 +352,6 @@ public class HexScreen extends AbstractScreen private void update(Tile t, Unit u) { - touchInfo(t); u.centerOn(t.cx, t.cy); u.dragging = false; if (u == panzer) |