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. |
Members
-
forceSetTimeOut : boolean
-
Tell Phaser to use setTimeOut even if raf is available.
Type:
- boolean
-
game : Phaser.Game
-
The currently running game.
Type:
-
isRunning : boolean
-
true if RequestAnimationFrame is running, otherwise false.
Type:
- boolean
Methods
-
isRAF()
-
Is the browser using requestAnimationFrame?
Returns:
- Type
- boolean
-
isSetTimeOut()
-
Is the browser using setTimeout?
Returns:
- Type
- 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.