@Override public boolean isButtonPressed (int button) { return input.isButtonPressed(button); }
static public boolean left () { return Gdx.input.isButtonPressed(Buttons.LEFT); }
static public boolean right () { return Gdx.input.isButtonPressed(Buttons.RIGHT); }
static public boolean middle () { return Gdx.input.isButtonPressed(Buttons.MIDDLE); }
static public boolean middle () { return Gdx.input.isButtonPressed(Buttons.MIDDLE); }
static public boolean right () { return Gdx.input.isButtonPressed(Buttons.RIGHT); }
static public boolean middle () { return Gdx.input.isButtonPressed(Buttons.MIDDLE); }
static public boolean left () { return Gdx.input.isButtonPressed(Buttons.LEFT); }
static public boolean right () { return Gdx.input.isButtonPressed(Buttons.RIGHT); }
static public boolean left () { return Gdx.input.isButtonPressed(Buttons.LEFT); }
static public boolean left () { return Gdx.input.isButtonPressed(Buttons.LEFT); }
static public boolean right () { return Gdx.input.isButtonPressed(Buttons.RIGHT); }
static public boolean middle () { return Gdx.input.isButtonPressed(Buttons.MIDDLE); }
@Override public void render () { if (Gdx.input.justTouched()) { Gdx.app.log("Input Test", "just touched, button: " + (Gdx.input.isButtonPressed(Buttons.LEFT) ? "left " : "") + (Gdx.input.isButtonPressed(Buttons.MIDDLE) ? "middle " : "") + (Gdx.input.isButtonPressed(Buttons.RIGHT) ? "right" : "") + (Gdx.input.isButtonPressed(Buttons.BACK) ? "back" : "") + (Gdx.input.isButtonPressed(Buttons.FORWARD) ? "forward" : "")); } for (int i = 0; i < 10; i++) { if (Gdx.input.getDeltaX(i) != 0 || Gdx.input.getDeltaY(i) != 0) { Gdx.app.log("Input Test", "delta[" + i + "]: " + Gdx.input.getDeltaX(i) + ", " + Gdx.input.getDeltaY(i)); } } // Gdx.input.setCursorPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2); // if(Gdx.input.isTouched()) { // Gdx.app.log("Input Test", "is touched"); // } }
public boolean touchDown (int x, int y, int pointer, int newParam) { if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) { Vector3 touchPoint = new Vector3(x, y, 0); worldCamera.unproject(touchPoint); effect.setPosition(touchPoint.x, touchPoint.y); } return false; }
public boolean touchDragged (int x, int y, int pointer) { if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) { Vector3 touchPoint = new Vector3(x, y, 0); worldCamera.unproject(touchPoint); effect.setPosition(touchPoint.x, touchPoint.y); } return false; }
public boolean touchDragged (int x, int y, int pointer) { if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) { Vector3 touchPoint = new Vector3(x, y, 0); worldCamera.unproject(touchPoint); effect.setPosition(touchPoint.x, touchPoint.y); } return false; }
public boolean touchDown (int x, int y, int pointer, int newParam) { if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) { Vector3 touchPoint = new Vector3(x, y, 0); worldCamera.unproject(touchPoint); effect.setPosition(touchPoint.x, touchPoint.y); } return false; }
@Override public void render () { angle += Gdx.graphics.getDeltaTime() * 45; matrix.setToRotation(axis, angle); Mesh meshToDraw = Gdx.input.isButtonPressed(0) ? meshCustomVA : mesh; Gdx.gl20.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl20.glClearColor(0.2f, 0.2f, 0.2f, 1); Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl20.glEnable(GL20.GL_TEXTURE_2D); Gdx.gl20.glEnable(GL20.GL_BLEND); Gdx.gl20.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); texture.bind(); shader.begin(); shader.setUniformMatrix("u_worldView", matrix); shader.setUniformi("u_texture", 0); meshToDraw.render(shader, GL20.GL_TRIANGLES); shader.end(); }
private BrushAction getAction() { final boolean primary = Gdx.input.isButtonPressed(BrushAction.PRIMARY.code); final boolean secondary = Gdx.input.isKeyPressed(BrushAction.SECONDARY.code); if (primary && secondary) { return BrushAction.SECONDARY; } else if (primary) { return BrushAction.PRIMARY; } return null; }