new RoundedRectangle( [x] [, y] [, width] [, height] [, radius])
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.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
x |
number |
<optional> |
0 | The x coordinate of the top-left corner of the Rectangle. |
y |
number |
<optional> |
0 | The y coordinate of the top-left corner of the Rectangle. |
width |
number |
<optional> |
0 | The width of the Rectangle. Should always be either zero or a positive value. |
height |
number |
<optional> |
0 | The height of the Rectangle. Should always be either zero or a positive value. |
radius |
number |
<optional> |
20 | Controls the radius of the rounded corners. |
Members
-
height : number
-
The height of the Rectangle. This value should never be set to a negative.
Type:
- number
-
radius : number
-
The radius of the rounded corners.
Type:
- number
-
<readonly> type : number
-
The const type of this object.
Type:
- number
-
width : number
-
The width of the Rectangle. This value should never be set to a negative.
Type:
- number
-
x : number
-
The x coordinate of the top-left corner of the Rectangle.
Type:
- number
-
y : number
-
The y coordinate of the top-left corner of the Rectangle.
Type:
- number
Methods
-
clone()
-
Returns a new RoundedRectangle object with the same values for the x, y, width, height and radius properties as this RoundedRectangle object.
Returns:
-
contains(x, y)
-
Determines whether the specified coordinates are contained within the region defined by this Rounded Rectangle object.
Parameters:
Name Type Description x
number The x coordinate of the point to test.
y
number The y coordinate of the point to test.
Returns:
A value of true if the RoundedRectangle Rectangle object contains the specified point; otherwise false.
- Type
- boolean