Skip to content

Rectangle.Contains Method

Definition

Namespace: Brine2D.Core

Overloads
Contains(Rectangle) Checks if this rectangle contains another rectangle entirely.
Contains(float, float) Checks if this rectangle contains a point.
Contains(Vector2) Checks if this rectangle contains a point.

Rectangle.Contains(Rectangle) Method

Checks if this rectangle contains another rectangle entirely.

public bool Contains(Brine2D.Core.Rectangle other);

Parameters

other Rectangle

Returns

System.Boolean

Rectangle.Contains(float, float) Method

Checks if this rectangle contains a point.

public bool Contains(float x, float y);

Parameters

x System.Single

The X coordinate of the point.

y System.Single

The Y coordinate of the point.

Returns

System.Boolean

Remarks

Points exactly on the right or bottom edges are NOT considered inside. This follows standard rect collision rules to avoid edge case issues.

Rectangle.Contains(Vector2) Method

Checks if this rectangle contains a point.

public bool Contains(System.Numerics.Vector2 point);

Parameters

point System.Numerics.Vector2

Returns

System.Boolean

Remarks

Points exactly on the right or bottom edges are NOT considered inside. This follows standard rect collision rules to avoid edge case issues.