Skip to main content

Circle

Namespace: MonineEngine.Core

Represents a circle, with a center position and radius.

public struct Circle

Inheritance ObjectValueTypeCircle

Properties

Center

Get or set the position of the center of the circle in world space.

public Vector2 Center { get; set; }

Property Value

Vector2

Radius

Get or set the distance, in pixels, from the center of the circle to the edge.

public float Radius { get; set; }

Property Value

Single

Constructors

Circle(Vector2, Single)

Constructs a new Circle with the given parameters.

Circle(Vector2 center, float radius)

Parameters

center Vector2
The position of the center of the circle in world space.

radius Single
The distance, in pixels, from the center of the circle to the edge.

Methods

Intersects(Circle)

Checks if the current Circle intersects with another Circle.

bool Intersects(Circle other)

Parameters

other Circle
The other circle to check.

Returns

Boolean
If this circle and the other circle intersect, true; otherwise, false.

GetBounds()

Gets the bounds of the circle as a .

Rectangle GetBounds()

Returns

Rectangle
A representing the rectangular bounds of the circle.