mouseX property

double mouseX

The x-coordinate of the mouse or touch position in the local coordinate system of this object.

Throws an exception if this object is not a descendant of the Stage.

Implementation

double get mouseX {
  if (inStage) {
    return globalToLocal(
      _sHelperPoint.setTo(
        stage!.pointer!.mouseX,
        stage!.pointer!.mouseY,
      ),
      _sHelperPoint,
    ).x;
  } else {
    throw 'To get mouseX object needs to be a descendant of Stage.';
  }
}