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
FloatThe X coord of the upper-left corner of the rectangle
-
y
FloatThe Y coord of the upper-left corner of the rectangle
-
width
FloatThe overall width of this rectangle
-
height
FloatThe overall height of this rectangle
Methods
clone
()
Rectangle
Creates a clone of this Rectangle instance
Returns:
Rectangle:
a copy of the rectangle
contains
(
Bool
-
x
-
y
Checks whether the x and y coordinates passed to this function are contained within this Rectangle
Parameters:
-
x
FloatThe X coordinate of the point to test
-
y
FloatThe Y coordinate of the point to test
Returns:
Bool:
Whether the x/y coords are within this Rectangle
Properties
height
Float
Default: 0
width
Float
Default: 0
x
Float
Default: 0
y
Float
Default: 0