actionDown method

void actionDown(
  1. int pointer,
  2. Offset localPosition
)

Implementation

void actionDown(int pointer, Offset localPosition) {
  final pos = getViewportPosition(localPosition);
  if (!_dragging && _rect != null && _rect!.contains(pos)) {
    _pointer = pointer;
    if (enableDirection) {
      _dragPosition = pos;
      _dragging = true;
    }
    _controller.onJoystickAction(
      JoystickActionEvent(
        id: actionId,
        event: ActionEvent.DOWN,
      ),
    );
    pressed();
  }
}