W3cubDocs

/Phaser

Class: Phaser.RequestAnimationFrame

Constructor

new RequestAnimationFrame(game, forceSetTimeOut)

Abstracts away the use of RAF or setTimeOut for the core game update loop.

Parameters
Name Type Argument Default Description
game Phaser.Game

A reference to the currently running game.

forceSetTimeOut boolean <optional>
false

Tell Phaser to use setTimeOut even if raf is available.

Source code: utils/RequestAnimationFrame.js (Line 15)

Public Properties

forceSetTimeOut : boolean

Tell Phaser to use setTimeOut even if raf is available.

Source code: utils/RequestAnimationFrame.js (Line 33)

game : Phaser.Game

The currently running game.

Source code: utils/RequestAnimationFrame.js (Line 22)

isRunning : boolean

true if RequestAnimationFrame is running, otherwise false.

Source code: utils/RequestAnimationFrame.js (Line 28)

Public Methods

isRAF() → {boolean}

Is the browser using requestAnimationFrame?

Returns
boolean -
Source code: utils/RequestAnimationFrame.js (Line 162)

isSetTimeOut() → {boolean}

Is the browser using setTimeout?

Returns
boolean -
Source code: utils/RequestAnimationFrame.js (Line 153)

start()

Starts the requestAnimationFrame running or setTimeout if unavailable in browser

Source code: utils/RequestAnimationFrame.js (Line 70)

stop()

Stops the requestAnimationFrame from running.

Source code: utils/RequestAnimationFrame.js (Line 134)

updateRAF()

The update method for the requestAnimationFrame

Source code: utils/RequestAnimationFrame.js (Line 103)

updateSetTimeout()

The update method for the setTimeout.

Source code: utils/RequestAnimationFrame.js (Line 119)

© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.RequestAnimationFrame.html