public class DragAndDrop extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DragAndDrop.Payload
The payload of a drag and drop operation.
|
static class |
DragAndDrop.Source
A target where a payload can be dragged from.
|
static class |
DragAndDrop.Target
A target where a payload can be dropped to.
|
Constructor and Description |
---|
DragAndDrop() |
Modifier and Type | Method and Description |
---|---|
void |
addSource(DragAndDrop.Source source) |
void |
addTarget(DragAndDrop.Target target) |
void |
clear()
Removes all targets and sources.
|
Actor |
getDragActor()
Returns the current drag actor, or null.
|
boolean |
isDragging() |
void |
removeSource(DragAndDrop.Source source) |
void |
removeTarget(DragAndDrop.Target target) |
void |
setButton(int button)
Sets the button to listen for, all other buttons are ignored.
|
void |
setDragActorPosition(float dragActorX,
float dragActorY) |
void |
setDragTime(int dragMillis)
Time in milliseconds that a drag must take before a drop will be considered valid.
|
void |
setTapSquareSize(float halfTapSquareSize)
Sets the distance a touch must travel before being considered a drag.
|
void |
setTouchOffset(float touchOffsetX,
float touchOffsetY)
Sets an offset in stage coordinates from the touch position which is used to determine the drop location.
|
public void addSource(DragAndDrop.Source source)
public void removeSource(DragAndDrop.Source source)
public void addTarget(DragAndDrop.Target target)
public void removeTarget(DragAndDrop.Target target)
public void clear()
public void setTapSquareSize(float halfTapSquareSize)
public void setButton(int button)
Input.Buttons.LEFT
. Use -1 for any button.public void setDragActorPosition(float dragActorX, float dragActorY)
public void setTouchOffset(float touchOffsetX, float touchOffsetY)
public boolean isDragging()
public Actor getDragActor()
public void setDragTime(int dragMillis)
Copyright © 2014. All Rights Reserved.