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

new PIXI()

Namespace-class for pixi.js.

Contains assorted static properties and enumerations.

Source code: pixi/Pixi.js, line 11

Public Properties

<static> blendModes : Object

Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.

Source code: pixi/Pixi.js, line 41

<internal, static> CANVAS_RENDERER : number

Internal:
  • This member is internal (protected) and may be modified or removed in the future.
Source code: pixi/Pixi.js, line 27

<static> defaultRenderOptions : Object

The default render options if none are supplied to {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}.

Source code: pixi/Pixi.js, line 162

<static> DEG_TO_RAD : number

Source code: pixi/Pixi.js, line 139

<static> dontSayHello : boolean

If true the default pixi startup (console) banner message will be suppressed.

Default Value
  • false
Source code: pixi/Pixi.js, line 153

<static> PI_2 : number

Source code: pixi/Pixi.js, line 127

<static> RAD_TO_DEG : number

Source code: pixi/Pixi.js, line 133

<internal, static> RETINA_PREFIX : string

Internal:
  • This member is internal (protected) and may be modified or removed in the future.
Source code: pixi/Pixi.js, line 145

<static> scaleModes : Object

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.

Source code: pixi/Pixi.js, line 83

<static> VERSION : string

Version of pixi that is loaded.

Source code: pixi/Pixi.js, line 34

<internal, static> WEBGL_RENDERER : number

Internal:
  • This member is internal (protected) and may be modified or removed in the future.
Source code: pixi/Pixi.js, line 21

Public Methods

<static> autoDetectRecommendedRenderer(width=800, height=600, options)

This helper function will automatically detect which renderer you should be using. This function is very similar to the autoDetectRenderer function except that is will return a canvas renderer for android. Even thought both android chrome supports webGL the canvas implementation perform better at the time of writing. This function will likely change and update as webGL performance improves on these devices.

Parameters
Name Type Argument Description
width=800 Number

the width of the renderers view

height=600 Number

the height of the renderers view

options Object <optional>

The optional renderer parameters

Properties
Name Type Argument Default Description
view HTMLCanvasElement <optional>

the canvas to use as a view, optional

transparent Boolean <optional>
false

If the render view is transparent, default false

antialias Boolean <optional>
false

sets antialias (only applicable in chrome at the moment)

preserveDrawingBuffer Boolean <optional>
false

enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context

resolution Number <optional>
1

the resolution of the renderer retina would be 2

Source code: pixi/utils/Detector.js, line 46

<static> autoDetectRenderer(width=800, height=600, options)

This helper function will automatically detect which renderer you should be using. WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by the browser then this function will return a canvas renderer

Parameters
Name Type Argument Description
width=800 Number

the width of the renderers view

height=600 Number

the height of the renderers view

options Object <optional>

The optional renderer parameters

Properties
Name Type Argument Default Description
view HTMLCanvasElement <optional>

the canvas to use as a view, optional

transparent Boolean <optional>
false

If the render view is transparent, default false

antialias Boolean <optional>
false

sets antialias (only applicable in chrome at the moment)

preserveDrawingBuffer Boolean <optional>
false

enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context

resolution Number <optional>
1

the resolution of the renderer retina would be 2

Source code: pixi/utils/Detector.js, line 5