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

Constructor

Public Properties

<constant> ANGLE_DOWN : integer

The Angle (in degrees) a Game Object needs to be set to in order to face down.

Source code: Phaser.js (Line 339)

<constant> ANGLE_LEFT : integer

The Angle (in degrees) a Game Object needs to be set to in order to face left.

Source code: Phaser.js (Line 346)

<constant> ANGLE_NORTH_EAST : integer

The Angle (in degrees) a Game Object needs to be set to in order to face north east.

Source code: Phaser.js (Line 360)

<constant> ANGLE_NORTH_WEST : integer

The Angle (in degrees) a Game Object needs to be set to in order to face north west.

Source code: Phaser.js (Line 367)

<constant> ANGLE_RIGHT : integer

The Angle (in degrees) a Game Object needs to be set to in order to face right.

Source code: Phaser.js (Line 353)

<constant> ANGLE_SOUTH_EAST : integer

The Angle (in degrees) a Game Object needs to be set to in order to face south east.

Source code: Phaser.js (Line 374)

<constant> ANGLE_SOUTH_WEST : integer

The Angle (in degrees) a Game Object needs to be set to in order to face south west.

Source code: Phaser.js (Line 381)

<constant> ANGLE_UP : integer

The Angle (in degrees) a Game Object needs to be set to in order to face up.

Source code: Phaser.js (Line 332)

<constant> AUTO : integer

AUTO renderer - picks between WebGL or Canvas based on device.

Source code: Phaser.js (Line 31)

<constant> BITMAPDATA : integer

Game Object type.

Source code: Phaser.js (Line 185)

<constant> BITMAPTEXT : integer

Game Object type.

Source code: Phaser.js (Line 136)

<constant> blendModes

Various blend modes supported by Pixi.

IMPORTANT: The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.

Properties:
Name Type Description
blendModes.NORMAL Number
blendModes.ADD Number
blendModes.MULTIPLY Number
blendModes.SCREEN Number
blendModes.OVERLAY Number
blendModes.DARKEN Number
blendModes.LIGHTEN Number
blendModes.COLOR_DODGE Number
blendModes.COLOR_BURN Number
blendModes.HARD_LIGHT Number
blendModes.SOFT_LIGHT Number
blendModes.DIFFERENCE Number
blendModes.EXCLUSION Number
blendModes.HUE Number
blendModes.SATURATION Number
blendModes.COLOR Number
blendModes.LUMINOSITY Number
Source code: Phaser.js (Line 499)

<constant> BOTTOM_CENTER : integer

A constant representing a bottom-center alignment or position.

Source code: Phaser.js (Line 465)

<constant> BOTTOM_LEFT : integer

A constant representing a bottom-left alignment or position.

Source code: Phaser.js (Line 458)

<constant> BOTTOM_RIGHT : integer

A constant representing a bottom-right alignment or position.

Source code: Phaser.js (Line 472)

<constant> BUTTON : integer

Game Object type.

Source code: Phaser.js (Line 101)

<constant> CANVAS : integer

Canvas Renderer.

Source code: Phaser.js (Line 38)

<constant> CANVAS_FILTER : integer

Game Object type.

Source code: Phaser.js (Line 192)

<constant> CENTER : integer

A constant representing a center alignment or position.

Source code: Phaser.js (Line 430)

<constant> CIRCLE : integer

Game Object type.

Source code: Phaser.js (Line 241)

<constant> CREATURE : integer

Game Object type.

Source code: Phaser.js (Line 283)

<constant> DOWN : integer

Direction constant.

Source code: Phaser.js (Line 87)

<constant> ELLIPSE : integer

Game Object type.

Source code: Phaser.js (Line 206)

<constant> EMITTER : integer

Game Object type.

Source code: Phaser.js (Line 171)

<constant> GAMES :array

An array of Phaser game instances.

Source code: Phaser.js (Line 24)

<constant> GRAPHICS : integer

Game Object type.

Source code: Phaser.js (Line 115)

<constant> GROUP : integer

Game Object type.

Source code: Phaser.js (Line 143)

<constant> HEADLESS : integer

Headless renderer (not visual output)

Source code: Phaser.js (Line 52)

<constant> HORIZONTAL : integer

A horizontal orientation

Source code: Phaser.js (Line 304)

<constant> IMAGE : integer

Game Object type.

Source code: Phaser.js (Line 108)

<constant> LANDSCAPE : integer

A landscape orientation

Source code: Phaser.js (Line 318)

<constant> LEFT : integer

Direction constant.

Source code: Phaser.js (Line 66)

<constant> LEFT_BOTTOM : integer

A constant representing a left-bottom alignment or position.

Source code: Phaser.js (Line 423)

<constant> LEFT_CENTER : integer

A constant representing a left-center alignment or position.

Source code: Phaser.js (Line 416)

<constant> LEFT_TOP : integer

A constant representing a left-top alignment or position.

Source code: Phaser.js (Line 409)

<constant> LINE : integer

Game Object type.

Source code: Phaser.js (Line 255)

<constant> MATRIX : integer

Game Object type.

Source code: Phaser.js (Line 262)

<constant> NONE : integer

Direction constant.

Source code: Phaser.js (Line 59)

<constant> PENDING_ATLAS : integer

Game Object type.

Source code: Phaser.js (Line 297)

<constant> POINT : integer

Game Object type.

Source code: Phaser.js (Line 269)

<constant> POINTER : integer

Game Object type.

Source code: Phaser.js (Line 227)

<constant> POLYGON : integer

Game Object type.

Source code: Phaser.js (Line 178)

<constant> PORTRAIT : integer

A portrait orientation

Source code: Phaser.js (Line 325)

<constant> RECTANGLE : integer

Game Object type.

Source code: Phaser.js (Line 248)

<constant> RENDERTEXTURE : integer

Game Object type.

Source code: Phaser.js (Line 150)

<constant> RETROFONT : integer

Game Object type.

Source code: Phaser.js (Line 220)

Direction constant.

Source code: Phaser.js (Line 73)

<constant> RIGHT_BOTTOM : integer

A constant representing a right-bottom alignment or position.

Source code: Phaser.js (Line 451)

<constant> RIGHT_CENTER : integer

A constant representing a right-center alignment or position.

Source code: Phaser.js (Line 444)

<constant> RIGHT_TOP : integer

A constant representing a right-top alignment or position.

Source code: Phaser.js (Line 437)

<constant> ROPE : integer

Game Object type.

Source code: Phaser.js (Line 234)

<constant> ROUNDEDRECTANGLE : integer

Game Object type.

Source code: Phaser.js (Line 276)

<constant> scaleModes

The scale modes that are supported by Pixi.

The DEFAULT scale mode affects the default scaling mode of future operations.
It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.

Properties:
Name Type Default Description
Phaser.scaleModes Object
scaleModes.DEFAULT Number LINEAR
scaleModes.LINEAR Number

Smooth scaling

scaleModes.NEAREST Number

Pixelating scaling

Source code: Phaser.js (Line 532)

<constant> SPRITE : integer

Game Object type.

Source code: Phaser.js (Line 94)

<constant> SPRITEBATCH : integer

Game Object type.

Source code: Phaser.js (Line 213)

<constant> TEXT : integer

Game Object type.

Source code: Phaser.js (Line 122)

<constant> TILEMAP : integer

Game Object type.

Source code: Phaser.js (Line 157)

<constant> TILEMAPLAYER : integer

Game Object type.

Source code: Phaser.js (Line 164)

<constant> TILESPRITE : integer

Game Object type.

Source code: Phaser.js (Line 129)

<constant> TOP_CENTER : integer

A constant representing a top-center alignment or position.

Source code: Phaser.js (Line 395)

<constant> TOP_LEFT : integer

A constant representing a top-left alignment or position.

Source code: Phaser.js (Line 388)

<constant> TOP_RIGHT : integer

A constant representing a top-right alignment or position.

Source code: Phaser.js (Line 402)

<constant> UP : integer

Direction constant.

Source code: Phaser.js (Line 80)

<constant> VERSION : string

The Phaser version number.

Source code: Phaser.js (Line 17)

<constant> VERTICAL : integer

A vertical orientation

Source code: Phaser.js (Line 311)

<constant> VIDEO : integer

Game Object type.

Source code: Phaser.js (Line 290)

<constant> WEBGL : integer

WebGL Renderer.

Source code: Phaser.js (Line 45)

<constant> WEBGL_FILTER : integer

Game Object type.

Source code: Phaser.js (Line 199)

Public Methods

displayList(displayObject)

Call this function from the Dev Tools console.

It will scan the display list and output all of the Objects it finds, and their renderOrderIDs.

Note Requires a browser that supports console.group and console.groupEnd (such as Chrome)

Parameters
Name Type Argument Description
displayObject Object <optional>

The displayObject level display object to start from. Defaults to the World.

Source code: utils/Debug.js (Line 844)

emit(eventName) → {Boolean}

Emit an event to all registered event listeners.

Parameters
Name Type Description
eventName String

The name of the event.

Returns
Boolean -

Indication if we've emitted an event.

Source code: plugins/path/EventTarget.js (Line 54)

listeners(eventName) → {Array}

Return a list of assigned event listeners.

Parameters
Name Type Description
eventName String

The events that should be listed.

Returns
Array -

An array of listener functions

Source code: plugins/path/EventTarget.js (Line 41)

mixin(object)

Mixes in the properties of the EventTarget prototype onto another object

Parameters
Name Type Description
object Object

The obj to mix into

Source code: plugins/path/EventTarget.js (Line 34)

off(eventName, callback)

Remove event listeners.

Parameters
Name Type Description
eventName String

The event we want to remove.

callback function

The listener that we need to find.

Source code: plugins/path/EventTarget.js (Line 143)

on(eventName, callback)

Register a new EventListener for the given event.

Parameters
Name Type Description
eventName String

Name of the event.

callback Functon

fn Callback function.

Source code: plugins/path/EventTarget.js (Line 107)

once(eventName, callback)

Add an EventListener that's only called once.

Parameters
Name Type Description
eventName String

Name of the event.

callback function

Callback function.

Source code: plugins/path/EventTarget.js (Line 124)

Phaser.Path#numPoints return {number} The total number of PathPoints in this Path.()

The total number of PathPoints in this Path.

Source code: plugins/path/Path.js (Line 536)

removeAllListeners(eventName)

Remove all listeners or only the listeners for the specified event.

Parameters
Name Type Description
eventName String

The event you want to remove all listeners for.

Source code: plugins/path/EventTarget.js (Line 173)

stopImmediatePropagation()

Stops the propagation of events to sibling listeners (no longer calls any listeners).

Source code: plugins/path/EventTarget.js (Line 277)

stopPropagation()

Stops the propagation of events up the scene graph (prevents bubbling).

Source code: plugins/path/EventTarget.js (Line 268)

Type Definitions

DisplayObject

A display object is any object that can be rendered in the Phaser/pixi.js scene graph.

This includes Phaser.Group (groups are display objects!),
Phaser.Sprite, Phaser.Button, Phaser.Text
as well as PIXI.DisplayObject and all derived types.

Source code: core/Group.js (Line 2958)