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(scrollPane);. 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 |
setPadding(float padTop,
float padBottom) |
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, touchUpenter, exit, handle, keyDown, keyTyped, keyUp, mouseMoved, scrolledpublic 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 DragListenerpublic void dragStop(InputEvent event, float x, float y, int pointer)
dragStop in class DragListenerpublic void setPadding(float padTop,
float padBottom)
Copyright © 2021. All rights reserved.