handlerPointerDown method
Implementation
@override
void handlerPointerDown(PointerDownEvent event) {
final pointer = event.pointer;
final position = event.localPosition.toVector2();
if (enableDrag && hasGameRef) {
if (this.isHud) {
if (containsPoint(position)) {
_pointer = pointer;
_startDragOffset = position;
_startDragPosition = this.position.clone();
onStartDrag(pointer, position);
}
} else {
final absolutePosition = this.gameRef.screenToWorld(position);
if (containsPoint(absolutePosition)) {
_pointer = pointer;
_startDragOffset = absolutePosition;
_startDragPosition = this.position.clone();
}
}
}
super.handlerPointerDown(event);
}