handlerPointerUp method

  1. @override
bool handlerPointerUp(
  1. PointerUpEvent event
)
override

Implementation

@override
bool handlerPointerUp(PointerUpEvent event) {
  final pointer = event.pointer;
  final position = event.localPosition.toVector2();

  if (enableTab && pointer == _pointer && hasGameRef) {
    if (isHud) {
      if (containsPoint(position)) {
        onTapUp(pointer, position);
        onTap();
      } else {
        onTapCancel();
      }
    } else {
      final absolutePosition = gameRef.screenToWorld(position);
      if (containsPoint(absolutePosition)) {
        onTapUp(pointer, position);
        onTap();
      } else {
        onTapCancel();
      }
    }
    _pointer = -1;
  }

  return super.handlerPointerUp(event);
}