handlerPointerDown method

  1. @override
bool handlerPointerDown(
  1. PointerDownEvent event
)
override

Implementation

@override
bool handlerPointerDown(PointerDownEvent event) {
  final pointer = event.pointer;
  final position = event.localPosition.toVector2();
  bool handler = false;

  if (enableTab && hasGameRef) {
    if (isHud) {
      if (containsPoint(position)) {
        _pointer = pointer;
        handler = onTapDown(pointer, position);
      }
    } else {
      final absolutePosition = gameRef.screenToWorld(position);
      if (containsPoint(absolutePosition)) {
        _pointer = pointer;
        handler = onTapDown(pointer, position);
      }
    }
  }
  return handler ? handler : super.handlerPointerDown(event);
}