From 7c879d254a0aba68f1245740c70c2f9964ac087d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 13 Jul 2020 08:37:11 +0200 Subject: HexScreen : show touch screen coords --- test/src/ch/asynk/gdx/boardgame/test/HexScreen.java | 9 +++++---- 1 file 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) -- cgit v1.1-2-g2b99