Rectangle Class
the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.
Constructor
Rectangle
(
-
x
-
y
-
width
-
height
Parameters:
-
x
Numberposition of the rectangle
-
y
Numberposition of the rectangle
-
width
Numberof the rectangle
-
height
Numberof the rectangle
Methods
clone
()
Returns:
a copy of the rectangle
contains
(
-
x
-
y
Parameters:
-
x
NumberThe X coord of the point to test
-
y
NumberThe Y coord of the point to test
Returns:
if the x/y coords are within this polygon
Properties
height
Number
Default: 0
width
Number
Default: 0
x
Number
Default: 0
y
Number
Default: 0