Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. if (Gdx.input.isTouched()) {
  2.         int realX = Gdx.input.getX();
  3.         int realY = Gdx.input.getY();
  4.         Gdx.app.debug("input", (String.valueOf(Gdx.input.getX())) + ", " + String.valueOf(Gdx.input.getY()));
  5.         Vector3 touchPos = new Vector3(realX, realY, 0);
  6.         camera.unproject(touchPos);
  7.         spaceshipRectangle.x = touchPos.x - spaceshipRectangle.width / 2;
  8.         spaceshipRectangle.y = touchPos.y - spaceshipRectangle.height / 2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement