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:
Members
-
forceSetTimeOut
-
- Source:
Properties:
Name Type Description forceSetTimeOut
boolean Tell Phaser to use setTimeOut even if raf is available.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game The currently running game.
-
isRunning
-
- Default Value:
- false
- Source:
Properties:
Name Type Description isRunning
boolean true if RequestAnimationFrame is running, otherwise false.
Methods
-
isRAF() → {boolean}
-
Is the browser using requestAnimationFrame?
- Source:
Returns:
- Type
- boolean
-
isSetTimeOut() → {boolean}
-
Is the browser using setTimeout?
- Source:
Returns:
- Type
- boolean
-
start()
-
Starts the requestAnimationFrame running or setTimeout if unavailable in browser
- Source:
-
stop()
-
Stops the requestAnimationFrame from running.
- Source:
-
updateRAF()
-
The update method for the requestAnimationFrame
- Source:
-
updateSetTimeout()
-
The update method for the setTimeout.
- Source: