Class: RoundedRectangle

RoundedRectangle

The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height and its radius.


new RoundedRectangle(x, y, width, height, radius)

Parameters:
Name Type Description
x number

The X coordinate of the upper-left corner of the rounded rectangle

y number

The Y coordinate of the upper-left corner of the rounded rectangle

width number

The overall width of this rounded rectangle

height number

The overall height of this rounded rectangle

radius number

Controls the radius of the rounded corners

Source:

Members


height :number

Type:
  • number
Default Value:
  • 0
Source:

radius :number

Type:
  • number
Default Value:
  • 20
Source:

type :number

The type of the object, mainly used to avoid instanceof checks

Type:
  • number
Source:

width :number

Type:
  • number
Default Value:
  • 0
Source:

x :number

Type:
  • number
Default Value:
  • 0
Source:

y :number

Type:
  • number
Default Value:
  • 0
Source:

Methods


clone()

Creates a clone of this Rounded Rectangle

Source:
Returns:

a copy of the rounded rectangle

Type
RoundedRectangle

contains(x, y)

Checks whether the x and y coordinates given are contained within this Rounded Rectangle

Parameters:
Name Type Description
x number

The X coordinate of the point to test

y number

The Y coordinate of the point to test

Source:
Returns:

Whether the x/y coordinates are within this Rounded Rectangle

Type
boolean