handlerPointerUp method

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

Implementation

@override
bool handlerPointerUp(PointerUpEvent event) {
  final tapEvent = GestureEvent.fromPointerEvent(
    event,
    screenToWorld: gameRef.screenToWorld,
    globalToViewportPosition: gameRef.globalToViewportPosition,
  );

  if (enableTab && tapEvent.pointer == _pointer && hasGameRef) {
    onTapUpScreen(tapEvent);
    if (isHud) {
      if (containsPoint(tapEvent.screenPosition)) {
        onTapUp(tapEvent);
        onTap();
      } else {
        onTapCancel();
      }
    } else {
      if (containsPoint(tapEvent.worldPosition)) {
        onTapUp(tapEvent);
        onTap();
      } else {
        onTapCancel();
      }
    }
    _pointer = -1;
  }

  return super.handlerPointerUp(event);
}