mini_arcade_core.spaces.collision.rect_collider

A simple rectangular collider for collision detection.

Classes

RectCollider

A simple rectangular collider for collision detection.

Module Contents

class mini_arcade_core.spaces.collision.rect_collider.RectCollider

A simple rectangular collider for collision detection.

Variables:
  • (Vec2) (position) – Top-left position of the rectangle.

  • (Size2D) (size) – Size of the rectangle.

position: mini_arcade_core.spaces.math.vec2.Vec2
size: mini_arcade_core.spaces.geometry.size.Size2D
property rect: mini_arcade_core.spaces.geometry.shapes.Rect

Get the bounding rectangle of the collider.

Returns:

Bounding rectangle.

Return type:

Rect

intersects(other: RectCollider, *, inclusive: bool = True) bool

Check if this rectangle collider intersects with another rectangle collider.

Parameters:

other (RectCollider) – The other rectangle collider.

Returns:

True if the rectangles intersect, False otherwise.

Return type:

bool