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. Circle

new Circle(x, y, radius)

The Circle object can be used to specify a hit area for displayObjects

Parameters
Name Type Description
x Number

The X coordinate of the center of this circle

y Number

The Y coordinate of the center of this circle

radius Number

The radius of the circle

Source code: pixi/geom/Circle.js, line 5

Public Properties

radius : number

Default Value
  • 0
Source code: pixi/geom/Circle.js, line 30

type : number

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

Default Value
  • 0
Source code: pixi/geom/Circle.js, line 37

x : number

Default Value
  • 0
Source code: pixi/geom/Circle.js, line 16

y : number

Default Value
  • 0
Source code: pixi/geom/Circle.js, line 23

Public Methods

clone() → {PIXI.Circle}

Creates a clone of this Circle instance

Returns

a copy of the Circle

Source code: pixi/geom/Circle.js, line 45

contains(x, y) → {Boolean}

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

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 Circle

Source code: pixi/geom/Circle.js, line 56

getBounds() → {PIXI.Rectangle}

Returns the framing rectangle of the circle as a PIXI.Rectangle object

Returns

the framing rectangle

Source code: pixi/geom/Circle.js, line 79