Created
February 9, 2014 22:19
-
-
Save sephto/8906876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InputHandler implements InputProcessor { | |
World world; | |
public boolean touchDown; | |
public float x,y; | |
static public InputHandler inputHandler; | |
public InputHandler(World world) { | |
this.world = world; | |
inputHandler = this; | |
} | |
//////////// GET THE MAIN INPUT HANDLER | |
public static InputHandler getInput() { | |
return inputHandler; | |
} | |
@Override | |
public boolean keyDown(int keycode) { | |
} | |
@Override | |
public boolean keyUp(int keycode) { | |
return true; | |
} | |
@Override | |
public boolean keyTyped(char character) { | |
return false; | |
} | |
@Override | |
public boolean touchDown(int screenX, int screenY, int pointer, int button) { | |
x=Gdx.input.getX(); | |
y=Gdx.input.getY(); | |
return true; | |
} | |
@Override | |
public boolean touchUp(int screenX, int screenY, int pointer, int button) { | |
x=Gdx.input.getX(); | |
y=Gdx.input.getY(); | |
return true; | |
} | |
@Override | |
public boolean touchDragged(int screenX, int screenY, int pointer) { | |
x=Gdx.input.getX(); | |
y=Gdx.input.getY(); | |
return true; | |
} | |
@Override | |
public boolean mouseMoved(int screenX, int screenY) { | |
return false; | |
} | |
@Override | |
public boolean scrolled(int amount) { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment