public class DragScrollListener extends DragListener
If ScrollPane.setFlickScroll(boolean)
is true, the scroll pane must have
ScrollPane.setCancelTouchFocus(boolean)
false. When a drag starts that should drag rather than flick scroll, cancel the
scroll pane's touch focus using stage.cancelTouchFocus(gloom.monstersScroll);
. In this case the drag scroll
listener must not be attached to the scroll pane, else it would also lose touch focus. Instead it can be attached to the scroll
pane's actor.
If using drag and drop, DragAndDrop.setCancelTouchFocus(boolean)
must be false.
Constructor and Description |
---|
DragScrollListener(ScrollPane scroll) |
Modifier and Type | Method and Description |
---|---|
void |
drag(InputEvent event,
float x,
float y,
int pointer) |
void |
dragStop(InputEvent event,
float x,
float y,
int pointer) |
void |
setup(float minSpeedPixels,
float maxSpeedPixels,
float tickSecs,
float rampSecs) |
cancel, dragStart, getButton, getDeltaX, getDeltaY, getDragDistance, getDragStartX, getDragStartY, getDragX, getDragY, getStageTouchDownX, getStageTouchDownY, getTapSquareSize, getTouchDownX, getTouchDownY, isDragging, setButton, setDragStartX, setDragStartY, setTapSquareSize, touchDown, touchDragged, touchUp
enter, exit, handle, keyDown, keyTyped, keyUp, mouseMoved, scrolled
public DragScrollListener(ScrollPane scroll)
public void setup(float minSpeedPixels, float maxSpeedPixels, float tickSecs, float rampSecs)
public void drag(InputEvent event, float x, float y, int pointer)
drag
in class DragListener
public void dragStop(InputEvent event, float x, float y, int pointer)
dragStop
in class DragListener
Copyright © 2018. All rights reserved.