Class: Rectangle

og.Rectangle

new og.Rectangle(left, top, right, bottom)

2D Rectangle class.
Name Type Description
left number optional Left coordinate. 0 - default.
top number optional Top coordinate. 0 - default.
right number optional Right coordinate. 0 - default.
bottom number optional Bottom coordinate. 0 - default.

Members

bottomnumber

Top coordinate.

leftnumber

Left coordinate.
Right coordinate.

topnumber

Top coordinate.

Methods

Clone rectangle object.
Returns:
Type Description
og.Rectangle

fit(width, height)

Returns true if rectangle fits their size in width and height.
Name Type Description
width number Width.
height number Height.

getDiagonal()

Returns rectangle diagonal size.

getHeight()

Returns rectangle height.

getSquare()

Returns rectangle area.

getWidth()

Returns rectangle width.