Navigation
These archived docs are for Phaser 2.4.7 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

<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 35)

<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 96)

<static> DEG_TO_RAD : number

Source code: pixi/Pixi.js (Line 83)

<static> game :PhaserGame

A reference to the Phaser Game instance that owns this Pixi renderer.

Source code: pixi/Pixi.js (Line 21)

<static> PI_2 : number

Source code: pixi/Pixi.js (Line 71)

<static> RAD_TO_DEG : number

Source code: pixi/Pixi.js (Line 77)

<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 89)

<static> VERSION : string

Version of pixi that is loaded.

Source code: pixi/Pixi.js (Line 42)

<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 28)

Public Methods

canUseNewCanvasBlendModes() → {Boolean}

Checks whether the Canvas BlendModes are supported by the current browser for drawImage

Returns
Boolean -

whether they are supported

Source code: pixi/utils/Utils.js (Line 25)

getNextPowerOfTwo(number) → {Number}

Given a number, this function returns the closest number that is a power of two this function is taken from Starling Framework as its pretty neat ;)

Parameters
Name Type Description
number Number

-

Returns
Number -

the closest number that is a power of two

Source code: pixi/utils/Utils.js (Line 63)

hex2rgb(hex)

Converts a hex color number to an [R, G, B] array

Parameters
Name Type Description
hex Number

-

Source code: pixi/utils/Utils.js (Line 5)

isPowerOfTwo(width, height) → {Boolean}

checks if the given width and height make a power of two texture

Parameters
Name Type Description
width Number

-

height Number

-

Returns
Boolean -
Source code: pixi/utils/Utils.js (Line 83)

rgb2hex(rgb)

Converts a color as an [R, G, B] array to a hex number

Parameters
Name Type Description
rgb Array

-

Source code: pixi/utils/Utils.js (Line 15)