Rounded Rectangle Class
the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.
Constructor
Rounded Rectangle
-
x
-
y
-
width
-
height
-
radius
Parameters:
-
x
NumberThe X coordinate of the upper-left corner of the rounded rectangle
-
y
NumberThe Y coordinate of the upper-left corner of the rounded rectangle
-
width
NumberThe overall width of this rounded rectangle
-
height
NumberThe overall height of this rounded rectangle
-
radius
NumberThe overall radius of this corners of this rounded rectangle
Methods
clone
()
Rounded Rectangle
Creates a clone of this Rounded Rectangle
Returns:
a copy of the rounded rectangle
contains
-
x
-
y
Checks whether the x and y coordinates given are contained within this Rounded Rectangle
Parameters:
-
x
NumberThe X coordinate of the point to test
-
y
NumberThe Y coordinate of the point to test
Returns:
Whether the x/y coordinates are within this Rounded Rectangle
Properties
height
Number
Default: 0
radius
Number
Default: 20
width
Number
Default: 0
x
Number
Default: 0
y
Number
Default: 0