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
- Source code: utils/RequestAnimationFrame.js (Line 33)
- Source code: utils/RequestAnimationFrame.js (Line 22)
- Source code: utils/RequestAnimationFrame.js (Line 28)
forceSetTimeOut : boolean
Tell Phaser to use setTimeOut even if raf is available.
game : Phaser.Game
The currently running game.
isRunning : boolean
true if RequestAnimationFrame is running, otherwise false.
Public Methods
- Source code: utils/RequestAnimationFrame.js (Line 162)
- Source code: utils/RequestAnimationFrame.js (Line 153)
- Source code: utils/RequestAnimationFrame.js (Line 70)
- Source code: utils/RequestAnimationFrame.js (Line 134)
- Source code: utils/RequestAnimationFrame.js (Line 103)
- Source code: utils/RequestAnimationFrame.js (Line 119)
isRAF() → {boolean}
Is the browser using requestAnimationFrame?
Returns
boolean -
isSetTimeOut() → {boolean}
Is the browser using setTimeout?
Returns
boolean -
start()
Starts the requestAnimationFrame running or setTimeout if unavailable in browser
stop()
Stops the requestAnimationFrame from running.
updateRAF()
The update method for the requestAnimationFrame
updateSetTimeout()
The update method for the setTimeout.
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.RequestAnimationFrame.html