Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Bounds

Hierarchy

  • Bounds

Index

Constructors

constructor

  • Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).

    Parameters

    Returns Bounds

  • Creates a Bounds object defined by the points it contains.

    Parameters

    Returns Bounds

Properties

max

max: Point

The bottom right corner of the rectangle.

min

min: Point

The top left corner of the rectangle.

Methods

contains

  • contains(otherBounds: Bounds): boolean
  • contains(point: Point): boolean
  • Returns true if the rectangle contains the given one.

    Parameters

    Returns boolean

  • Returns true if the rectangle contains the given point.

    Parameters

    Returns boolean

extend

  • extend(point: Point): void
  • Extends the bounds to contain the given point.

    Parameters

    Returns void

getCenter

  • Returns the center point of the bounds.

    Returns Point

getSize

  • Returns the size of the given bounds.

    Returns Point

intersects

  • intersects(otherBounds: Bounds): boolean
  • Returns true if the rectangle intersects the given bounds.

    Parameters

    Returns boolean

isValid

  • isValid(): boolean
  • Returns true if the bounds are properly initialized.

    Returns boolean