Struct Rect
Represents a rectangle for collision detection.
public readonly struct Rect
- Inherited Members
Constructors
Rect(double, double, double, double)
public Rect(double x, double y, double width, double height)
Parameters
Properties
Bottom
public double Bottom { get; }
Property Value
Center
public Point Center { get; }
Property Value
Height
public double Height { get; }
Property Value
Left
public double Left { get; }
Property Value
Right
public double Right { get; }
Property Value
Top
public double Top { get; }
Property Value
Width
public double Width { get; }
Property Value
X
public double X { get; }
Property Value
Y
public double Y { get; }
Property Value
Methods
Contains(Point)
Checks if this rectangle contains a point.
public bool Contains(Point point)
Parameters
pointPoint
Returns
Inflate(double)
Returns an inflated copy of this rectangle.
public Rect Inflate(double amount)
Parameters
amountdouble
Returns
Intersects(Rect)
Checks if this rectangle intersects with another.
public bool Intersects(Rect other)
Parameters
otherRect
Returns
IntersectsLine(Point, Point)
Checks if a line segment intersects this rectangle.
public bool IntersectsLine(Point start, Point end)