RectExtension extension
- on
Methods
-
containsPoint(
Vector2 point) → bool -
Available on Rect, provided by the RectExtension extension
Whether this Rect contains a Vector2 point or not -
intersectsLineSegment(
LineSegment segment) → bool -
Available on Rect, provided by the RectExtension extension
Whether the LineSegment intersects the Rect -
intersectsSegment(
Vector2 pointA, Vector2 pointB) → bool -
Available on Rect, provided by the RectExtension extension
Whether the segment formed bypointA
andpointB
intersects this Rect -
randomPoint(
[Random? random]) → Vector2 -
Available on Rect, provided by the RectExtension extension
Generates a random point within the bounds of this Rect. -
toFlameRectangle(
) → Rectangle -
Available on Rect, provided by the RectExtension extension
Converts this Rect into a flame.Rectangle. -
toMathRectangle(
) → Rectangle< num> -
Available on Rect, provided by the RectExtension extension
Converts this Rect into a math.Rectangle. -
toOffset(
) → Offset -
Available on Rect, provided by the RectExtension extension
Creates an Offset from this Rect -
toRectangleComponent(
) → RectangleComponent -
Available on Rect, provided by the RectExtension extension
Converts this Rect into a RectangleComponent. -
toVector2(
) → Vector2 -
Available on Rect, provided by the RectExtension extension
Creates a Vector2 starting in top left and going to (width, height). -
toVertices(
) → List< Vector2> -
Available on Rect, provided by the RectExtension extension
-
transform(
Matrix4 matrix) → Rect -
Available on Rect, provided by the RectExtension extension
Transform Rect using the transformation defined bymatrix
.
Static Methods
-
fromCenter(
{required Vector2 center, required double width, required double height}) → Rect -
Available on Rect, provided by the RectExtension extension
Constructs a Rect with awidth
andheight
around thecenter
point. -
getBounds(
List< Vector2> pts) → Rect -
Available on Rect, provided by the RectExtension extension
Creates a Rect that represents the bounds of the listpts
.