Example #1
0
  private void _touchButton() {
    Long time = System.currentTimeMillis();
    if (time - lastClickTime > 200) {
      lastClickTime = time;

      touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0);
      touchPos = viewport.unproject(touchPos);
      dragonWarsEngine.touch(touchPos.x, touchPos.y);
    }
  }
Example #2
0
 /**
  * Transforms the screen coordinates to stage coordinates.
  *
  * @param screenCoords Input screen coordinates and output for resulting stage coordinates.
  */
 public Vector2 screenToStageCoordinates(Vector2 screenCoords) {
   viewport.unproject(screenCoords);
   return screenCoords;
 }