Struct ScreenPoint
A position in screen pixels, origin at the top-left with Y increasing downward.
public readonly struct ScreenPoint
- Inherited Members
Remarks
This is the graphics convention, not Unity's input convention: Unity reports mouse and touch positions with the origin at the bottom-left and Y increasing upward. The public MonoBehaviour surface flips between the two, so callers working in Unity screen space should use ScreenMapView.ScreenToLatLon and LatLonToScreen rather than building a ScreenPoint by hand.
Constructors
ScreenPoint(double, double)
Creates a screen position, top-left origin.
public ScreenPoint(double x, double y)
Parameters
xdoubleHorizontal position in screen px from the left edge.
ydoubleVertical position in screen px from the top edge.
Properties
Magnitude
Magnitude of the vector, in screen px.
public double Magnitude { get; }
Property Value
SqrMagnitude
Squared magnitude of the vector, in screen px squared (avoids sqrt).
public double SqrMagnitude { get; }
Property Value
X
Horizontal position in screen px from the left edge.
public double X { get; }
Property Value
Y
Vertical position in screen px from the top edge.
public double Y { get; }
Property Value
Operators
operator +(ScreenPoint, ScreenPoint)
Add two screen positions component-wise.
public static ScreenPoint operator +(ScreenPoint a, ScreenPoint b)
Parameters
Returns
operator *(ScreenPoint, double)
Scale a screen position by a scalar value.
public static ScreenPoint operator *(ScreenPoint a, double scalar)
Parameters
aScreenPointscalardouble
Returns
operator *(double, ScreenPoint)
Scale a screen position by a scalar value.
public static ScreenPoint operator *(double scalar, ScreenPoint a)
Parameters
scalardoubleaScreenPoint
Returns
operator -(ScreenPoint, ScreenPoint)
Subtract two screen positions component-wise, returning a delta vector.
public static ScreenPoint operator -(ScreenPoint a, ScreenPoint b)