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

new AjaxRequest()

A wrapper for ajax requests to be handled cross browser

Source code: pixi/utils/Utils.js, line 108

Public Methods

bind()

A polyfill for Function.prototype.bind

Source code: pixi/utils/Utils.js, line 74

cancelAnimationFrame()

A polyfill for cancelAnimationFrame

Source code: pixi/utils/Utils.js, line 20

canUseNewCanvasBlendModes() → {Boolean}

Checks whether the Canvas BlendModes are supported by the current browser

Returns
Boolean -

whether they are supported

Source code: pixi/utils/Utils.js, line 168

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 189

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 54

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 209

requestAnimationFrame()

A polyfill for requestAnimationFrame You can actually use both requestAnimationFrame and requestAnimFrame, you will still benefit from the polyfill

Source code: pixi/utils/Utils.js, line 12

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 64