Class: RoundedRectangle

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

Name Type Attributes Default Description
x number <optional>
0

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

y number <optional>
0

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

width number <optional>
0

The overall width of this rounded rectangle

height number <optional>
0

The overall height of this rounded rectangle

radius number <optional>
20

Controls the radius of the rounded corners

Members

height number

Default Value:
  • 0

radius number

Default Value:
  • 20

type number readonly

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

Default Value:
  • PIXI.SHAPES.RREC
See:

width number

Default Value:
  • 0

x number

Default Value:
  • 0

y number

Default Value:
  • 0

Methods

Creates a clone of this Rounded Rectangle

Returns:
Type Description
PIXI.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