Class: RequestAnimationFrame

Phaser. RequestAnimationFrame

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:
src/utils/RequestAnimationFrame.js line 15

Members

forceSetTimeOut : boolean

Tell Phaser to use setTimeOut even if raf is available.

Type:
  • boolean
Source:
src/utils/RequestAnimationFrame.js line 34

game : Phaser.Game

The currently running game.

Type:
Source:
src/utils/RequestAnimationFrame.js line 23

isRunning : boolean

true if RequestAnimationFrame is running, otherwise false.

Type:
  • boolean
Source:
src/utils/RequestAnimationFrame.js line 29

Methods

isRAF()

Is the browser using requestAnimationFrame?

Source:
src/utils/RequestAnimationFrame.js line 170
Returns:
Type
boolean

isSetTimeOut()

Is the browser using setTimeout?

Source:
src/utils/RequestAnimationFrame.js line 160
Returns:
Type
boolean

start()

Starts the requestAnimationFrame running or setTimeout if unavailable in browser

Source:
src/utils/RequestAnimationFrame.js line 71

stop()

Stops the requestAnimationFrame from running.

Source:
src/utils/RequestAnimationFrame.js line 140

updateRAF()

The update method for the requestAnimationFrame

Source:
src/utils/RequestAnimationFrame.js line 107

updateSetTimeout()

The update method for the setTimeout.

Source:
src/utils/RequestAnimationFrame.js line 124

phaser-ce@2.11.0 is on GitHub and NPM

Documentation generated by JSDoc 3.5.4 on 2018-06-26 using Tomorrow.