Class: RoundedRectangle

Tiny. 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 Tiny.RoundedRectangle(x, y, width, height, radius)

Name Type Default Description
x number 0 optional

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

y number 0 optional

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

width number 0 optional

The overall width of this rounded rectangle

height number 0 optional

The overall height of this rounded rectangle

radius number 20 optional

Controls the radius of the rounded corners

Members

heightnumber

Default Value:
  • 0

radiusnumber

Default Value:
  • 20

readonlytypenumber

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

Default Value:
  • Tiny.SHAPES.RREC
See:

widthnumber

Default Value:
  • 0

xnumber

Default Value:
  • 0

ynumber

Default Value:
  • 0

Methods

Creates a clone of this Rounded Rectangle

Returns:
Type Description
Tiny.RoundedRectangle a copy of the rounded rectangle

contains(x, y){boolean}

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

Name Type Description
x number

The X coordinate of the point to test

y number

The Y coordinate of the point to test

Returns:
Type Description
boolean Whether the x/y coordinates are within this Rounded Rectangle
Documentation generated by JSDoc 3.4.3 on Fri Jul 09 2021 19:32:27 GMT+0800 (CST)