@Override public boolean touchDown (int x, int y, int pointer, int button) { return ui.touchDown(x, y, pointer, button); }
@Override public void onMouseClick(int button, boolean up) { if(up) { stage.touchUp(mouseX, mouseY, 0, button); } else { stage.touchDown(mouseX, mouseY, 0, button); } }
@Override public boolean touchDown(int screenX, int screenY, int pointer, int button) { return stage.touchDown(screenX, screenY, pointer, button) || !isTransparent(); }
@Override public void onMouseClick(int button, boolean up) { if(up) { stage.touchUp(mouseX, mouseY, 0, button); } else { stage.touchDown(mouseX, mouseY, 0, button); } }
@Override public void onMouseClick(int button, boolean up) { if(up) { stage.touchUp(mouseX, mouseY, 0, button); } else { stage.touchDown(mouseX, mouseY, 0, button); } }
@Override public boolean touchDown(int screenX, int screenY, int pointer, int button) { return stage.touchDown(screenX, screenY, pointer, button) || !isTransparent(); }
/** Called when the screen was touched or a mouse button was pressed. The button parameter will be {@link Buttons#LEFT} on iOS. * @param screenX The x coordinate, origin is in the upper left corner * @param screenY The y coordinate, origin is in the upper left corner * @param pointer the pointer for the event. * @param button the button * @return whether the input was processed */ public boolean touchDown (int screenX, int screenY, int pointer, int button){ if($.allMatch(processors(), p -> p.touchDown(screenX, screenY, pointer, button)) && onInput()){ stage.touchDown(screenX, screenY, pointer, button); return bubble; } return false; };
@Override public boolean touchDown(int x, int y, int pointer, int button) { // Need to get the actual coordinates translateScreenToWorldCoordinates(x, y); if (rightSideTouched(touchPoint.x, touchPoint.y)) { runner.jump(); } else if (leftSideTouched(touchPoint.x, touchPoint.y)) { runner.dodge(); } return super.touchDown(x, y, pointer, button); }
/** Emulate stage input to maintain pre-existing input processor. */ private void processInput() { if ( Gdx.input.isButtonPressed(Input.Buttons.LEFT)) { if ( !leftMouseDown) { leftMouseDown = true; stage.touchDown(Gdx.input.getX(), Gdx.input.getY(), 0, Input.Buttons.LEFT); } else { stage.touchDragged(Gdx.input.getX(), Gdx.input.getY(), 0); } } else if (leftMouseDown) { leftMouseDown = false; stage.touchUp(Gdx.input.getX(), Gdx.input.getY(), 0, Input.Buttons.LEFT); } }
/** Emulate stage input to maintain pre-existing input processor. */ private void processInput() { if ( Gdx.input.isButtonPressed(Input.Buttons.LEFT)) { if ( !leftMouseDown) { leftMouseDown = true; stage.touchDown(Gdx.input.getX(), Gdx.input.getY(), 0, Input.Buttons.LEFT); } else { stage.touchDragged(Gdx.input.getX(), Gdx.input.getY(), 0); } } else if (leftMouseDown) { leftMouseDown = false; stage.touchUp(Gdx.input.getX(), Gdx.input.getY(), 0, Input.Buttons.LEFT); } }