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

Constructor

PIXI. 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: pixi/geom/RoundedRectangle.js, line 5

Public Properties

height : number

Default Value
  • 0
Source code: pixi/geom/RoundedRectangle.js, line 39

radius : number

Default Value
  • 20
Source code: pixi/geom/RoundedRectangle.js, line 46

type : number

The type of the object, should be one of the Graphics type consts, PIXI.Graphics.RRECT in this case

Default Value
  • 0
Source code: pixi/geom/RoundedRectangle.js, line 53

width : number

Default Value
  • 0
Source code: pixi/geom/RoundedRectangle.js, line 32

x : number

Default Value
  • 0
Source code: pixi/geom/RoundedRectangle.js, line 18

y : number

Default Value
  • 0
Source code: pixi/geom/RoundedRectangle.js, line 25

Public Methods

clone() → {PIXI.RoundedRectangle}

Creates a clone of this Rounded Rectangle

Returns

a copy of the rounded rectangle

Source code: pixi/geom/RoundedRectangle.js, line 61

contains(x, y) → {Boolean}

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

Returns
Boolean -

Whether the x/y coordinates are within this Rounded Rectangle

Source code: pixi/geom/RoundedRectangle.js, line 72