Class RectangleExtensions
- Namespace
- Fantas
- Assembly
- Fantas.dll
RectangleF extension methods
public static class RectangleExtensions
- Inheritance
-
RectangleExtensions
- Inherited Members
Methods
Center(Rectangle)
Return the center point of rectangle
public static PointF Center(this Rectangle rect)
Parameters
rect
Rectangle
Returns
Center(RectangleF)
Return the center point of rectangle
public static PointF Center(this RectangleF rect)
Parameters
rect
RectangleF
Returns
GetIntersectionDepth(RectangleF, RectangleF)
Calculates the signed depth of intersection between two rectangles.
public static Vector2 GetIntersectionDepth(this RectangleF rectA, RectangleF rectB)
Parameters
rectA
RectangleFrectB
RectangleF
Returns
- Vector2
The amount of overlap between two intersecting rectangles. These depth values can be negative depending on which wides the rectangles intersect. This allows callers to determine the correct direction to push objects in order to resolve collisions. If the rectangles are not intersecting, Vector2.Zero is returned.