Home Reference Source Test
public class | source

Bounds

Two points which represent a bounding square.

TODO: Add z index for 3D.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

p1: *

public

p2: *

Method Summary

Public Methods
public

isInBounds(point: Point): *

Checks to see if the point [parameter 0] is within bounds.

public

set(x: number, y: number, w: number, h: number)

Sets the bounding box to a new position.

Public Constructors

public constructor(x: number, y: number, w: number, h: number) source

Params:

NameTypeAttributeDescription
x number

The x position of the bounding box. (x1)

y number

The y position of the bounding box. (y1)

w number

The end x position, or width, of the bounding box. (x2)

h number

The end x position, or height, of the bounding box. (y2)

Public Members

public p1: * source

public p2: * source

Public Methods

public isInBounds(point: Point): * source

Checks to see if the point [parameter 0] is within bounds.

Params:

NameTypeAttributeDescription
point Point

Point to check within bounds.

Return:

*

public set(x: number, y: number, w: number, h: number) source

Sets the bounding box to a new position.

Params:

NameTypeAttributeDescription
x number

The x position of the bounding box. (x1)

y number

The y position of the bounding box. (y1)

w number

The end x position, or width, of the bounding box. (x2)

h number

The end x position, or height, of the bounding box. (y2)