Bounds.BoundingRectangle

Description: Defines a rectangle that can be used to detect intersections.

Extends: Bounds.Bounds2d

Constructors

BoundingRectangle (position, size)
Creates a new instance of BoundingRectangle.

position: EndGate.Vector2d
Initial Position of the BoundingRectangle.

size: EndGate.Size2d
Initial Size of the BoundingRectangle.

Fields

Size: EndGate.Size2d
Gets or sets the Size of the rectangle.

TopLeft: EndGate.Vector2d
Gets the top left corner of the BoundingRectangle.

TopRight: EndGate.Vector2d
Gets the top right corner of the BoundingRectangle.

BotLeft: EndGate.Vector2d
Gets the bottom left corner of the BoundingRectangle.

BotRight: EndGate.Vector2d
Gets the bottom right corner of the BoundingRectangle.

Inherited from: Bounds.Bounds2d

Position: EndGate.Vector2d
Gets or sets the Position of the bounds.

Rotation: number
Gets or sets the Rotation of the bounds.

Methods

Scale()
Scales the width and height of the BoundingRectangle.

Corners()
Returns a list of vertices that are the locations of each corner of the BoundingRectangle. Format: [TopLeft, TopRight, BotLeft, BotRight].

IntersectsCircle()
Determines if the current BoundingRectangle is intersecting the provided BoundingCircle.

IntersectsRectangle()
Determines if the current BoundingRectangle is intersecting the provided BoundingRectangle.

ContainsPoint()
Determines if the current BoundingRectangle contains the provided Vector2d.

ContainsCircle()
Determines if the current BoundingRectangle completely contains the provided BoundingCircle.

ContainsRectangle()
Determines if the current BoundingCircle completely contains the provided BoundingRectangle.

Inherited from: Bounds.Bounds2d

Contains()
Abstract: Determines if the current bounded object contains the provided Vector2d.

Intersects()
Determines if the current bounded object intersects another bounded object.

Examples

There's currently no example available for this page. If you'd like to suggest one send me an containing a description, code, and link to the page for the suggested example. As a thanks I'll associate the code snippet with your name directly below the example if approved.