List of usage examples for com.badlogic.gdx.scenes.scene2d InputListener touchDown
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
From source file:es.eucm.ead.editor.view.widgets.Slider.java
License:Open Source License
public Slider(float min, float max, float stepSize, boolean vertical, SliderStyle style) { super(min, max, stepSize, vertical, style); final InputListener inputListener = (InputListener) getListeners().get(0); clearListeners();//from w w w . j av a 2s .c om addListener(new InputListener() { @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { return inputListener.touchDown(event, x, y, pointer, button); } @Override public void touchUp(InputEvent event, float x, float y, int pointer, int button) { inputListener.touchUp(event, x, y, pointer, button); } @Override public void touchDragged(InputEvent event, float x, float y, int pointer) { getStage().cancelTouchFocusExcept(Slider.this.getListeners().first(), Slider.this); inputListener.touchDragged(event, x, y, pointer); } }); }
From source file:es.eucm.ead.editor.view.widgets.Slider.java
License:Open Source License
public boolean addInputListener(final InputListener listener) { final InputListener inputListener = (InputListener) getListeners().get(0); clearListeners();// w w w . j av a 2s . com return addListener(new InputListener() { @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { inputListener.touchDown(event, x, y, pointer, button); listener.touchDown(event, x, y, pointer, button); return true; } @Override public void touchUp(InputEvent event, float x, float y, int pointer, int button) { inputListener.touchUp(event, x, y, pointer, button); listener.touchUp(event, x, y, pointer, button); } @Override public void touchDragged(InputEvent event, float x, float y, int pointer) { inputListener.touchDragged(event, x, y, pointer); listener.touchDragged(event, x, y, pointer); } }); }