Class DragAndDrop.Target
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.utils.DragAndDrop.Target
-
- Enclosing class:
- DragAndDrop
public abstract static class DragAndDrop.Target extends java.lang.Object
A target where a payload can be dropped to.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
drag(DragAndDrop.Source source, DragAndDrop.Payload payload, float x, float y, int pointer)
Called when the payload is dragged over the target.abstract void
drop(DragAndDrop.Source source, DragAndDrop.Payload payload, float x, float y, int pointer)
Called when the payload is dropped on the target.Actor
getActor()
void
reset(DragAndDrop.Source source, DragAndDrop.Payload payload)
Called when the payload is no longer over the target, whether because the touch was moved or a drop occurred.
-
-
-
Constructor Detail
-
Target
public Target(Actor actor)
-
-
Method Detail
-
drag
public abstract boolean drag(DragAndDrop.Source source, DragAndDrop.Payload payload, float x, float y, int pointer)
Called when the payload is dragged over the target. The coordinates are in the target's local coordinate system.- Returns:
- true if this is a valid target for the payload.
-
reset
public void reset(DragAndDrop.Source source, DragAndDrop.Payload payload)
Called when the payload is no longer over the target, whether because the touch was moved or a drop occurred. This is called even ifdrag(Source, Payload, float, float, int)
returned false.
-
drop
public abstract void drop(DragAndDrop.Source source, DragAndDrop.Payload payload, float x, float y, int pointer)
Called when the payload is dropped on the target. The coordinates are in the target's local coordinate system. This is not called ifdrag(Source, Payload, float, float, int)
returned false.
-
getActor
public Actor getActor()
-
-