Navigation
These archived docs are for Phaser 2.3.0 Phaser 3 docs can be found on newdocs.phaser.io.
Phaser CE docs can be found on the Phaser CE Documentation site.

Constructor

RoundedRectangle

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 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 code: geom/RoundedRectangle.js (Line 16)

Public Properties

height : number

Default Value
  • 0
Source code: geom/RoundedRectangle.js (Line 44)

radius : number

Default Value
  • 20
Source code: geom/RoundedRectangle.js (Line 51)

[readonly] type : number

The const type of this object.

Source code: geom/RoundedRectangle.js (Line 57)

width : number

Default Value
  • 0
Source code: geom/RoundedRectangle.js (Line 37)

x : number

Default Value
  • 0
Source code: geom/RoundedRectangle.js (Line 23)

y : number

Default Value
  • 0
Source code: geom/RoundedRectangle.js (Line 30)