I tried implementing a DragListener to drag some Tables around but for some reason the drag events stop during dragging. "dragStop" and "touchUp" are called when the drag moves to far away from the point where dragging was started ("to far" means something like 5mm/0.2 inches).
This is the code I'm using for testing purposes:
- Code: Select all
listItemTop.addListener(new EventListener() {
@Override
public boolean handle(Event event) {
if (event instanceof InputEvent) {
System.out.println("EventListener: "+((InputEvent) event).getType());
}
return false;
}
});
DragListener listener = new DragListener() {
public void dragStart (InputEvent event, float x, float y, int pointer) {
System.out.println("Draglistener: dragStart");
}
public void drag (InputEvent event, float x, float y, int pointer) {
System.out.println("Draglistener: drag");
}
public void dragStop (InputEvent event, float x, float y, int pointer) {
System.out.println("Draglistener: dragStop");
}
@Override
public boolean handle(Event e) {
System.out.println("Draglistener: " + e);
return super.handle(e);
}
};
And this is the output I get (with a few comments):
- Code: Select all
// ....
Draglistener: mouseMoved
EventListener: touchDown //touchdown
Draglistener: touchDown
EventListener: enter
Draglistener: enter
Draglistener: touchDragged // start dragging
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: touchDragged
Draglistener: dragStart
Draglistener: drag
Draglistener: touchDragged
Draglistener: drag
Draglistener: touchDragged
Draglistener: drag
Draglistener: touchDragged
Draglistener: drag
Draglistener: touchDragged
Draglistener: drag
Draglistener: touchDragged
Draglistener: drag
Draglistener: touchUp //still dragging, but no more output is given until i release mouse button
Draglistener: dragStop
I hope you can help me solving this annoying problem
Thanks,
twinflyer
