protected void processTouchDragged() { int dropX = 0; int dropY = 0; if (!locked) { boolean moveActor = false; if (actorDrag) { synchronized (objects) { dropX = this.input.getTouchX() - this.getScreenX(); dropY = this.input.getTouchY() - this.getScreenY(); if (dragActor == null) { dragActor = getSynchronizedObject(dropX, dropY); } if (dragActor != null && dragActor.isDrag()) { synchronized (dragActor) { objects.sendToFront(dragActor); RectBox rect = dragActor.getBoundingRect(); int dx = dropX - (rect.width / 2); int dy = dropY - (rect.height / 2); if (dragActor.getLLayer() != null) { dragActor.setLocation(dx, dy); dragActor.drag(dropX, dropY); if (dragActor.actorListener != null) { dragActor.actorListener.drag(dropX, dropY); } } moveActor = true; } } } } if (!moveActor) { if (isNotMoveInScreen( this.input.getTouchDX() + this.x(), this.input.getTouchDY() + this.y())) { return; } if (getContainer() != null) { getContainer().sendToFront(this); } dropX = this.input.getTouchDX(); dropY = this.input.getTouchDY(); this.move(dropX, dropY); this.drag(dropX, dropY); } } else { if (!actorDrag) { return; } synchronized (objects) { dropX = this.input.getTouchX() - this.getScreenX(); dropY = this.input.getTouchY() - this.getScreenY(); if (dragActor == null) { dragActor = getSynchronizedObject(dropX, dropY); } if (dragActor != null && dragActor.isDrag()) { synchronized (dragActor) { objects.sendToFront(dragActor); RectBox rect = dragActor.getBoundingRect(); int dx = dropX - (rect.width / 2); int dy = dropY - (rect.height / 2); if (dragActor.getLLayer() != null) { dragActor.setLocation(dx, dy); dragActor.drag(dropX, dropY); if (dragActor.actorListener != null) { dragActor.actorListener.drag(dropX, dropY); } } } } } } }