Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Gdx.input.isTouched()) {
- int realX = Gdx.input.getX();
- int realY = Gdx.input.getY();
- Gdx.app.debug("input", (String.valueOf(Gdx.input.getX())) + ", " + String.valueOf(Gdx.input.getY()));
- Vector3 touchPos = new Vector3(realX, realY, 0);
- camera.unproject(touchPos);
- spaceshipRectangle.x = touchPos.x - spaceshipRectangle.width / 2;
- spaceshipRectangle.y = touchPos.y - spaceshipRectangle.height / 2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement