Options
All
  • Public
  • Public/Protected
  • All
Menu

Alternative 2D box object with less memory impact (four numbers instead of two min/max objects with two numbers each). Should be faster.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Box(x?: number, y?: number, w?: number, h?: number): Box
  • Alternative 2D box object with less memory impact (four numbers instead of two min/max objects with two numbers each). Should be faster.

    Parameters

    • Default value x: number = 0

      New X value.

    • Default value y: number = 0

      New y value.

    • Default value w: number = 0

      New w value.

    • Default value h: number = 0

      New h value.

    Returns Box

Properties

h

h: number

New h value.

w

w: number

New w value.

x

x: number

New X value.

y

y: number

New y value.

Methods

contains

  • contains(x: number, y: number): boolean
  • Test box for inclusion of point.

    Parameters

    • x: number

      X coordinate of point.

    • y: number

      Y coordinate of point.

    Returns boolean

containsBox

  • containsBox(other: Box): boolean

copy

  • copy(box: Box): void

intersects

  • intersects(other: Box): boolean

set

  • set(x: number, y: number, w: number, h: number): void
  • Set new values to all properties of the box.

    Parameters

    • x: number

      New X value.

    • y: number

      New y value.

    • w: number

      New w value.

    • h: number

      New h value.

    Returns void

Generated using TypeDoc