Abstracts away the use of RAF or setTimeOut for the core game update loop.
This is invoked automatically by the Phaser.Game instance.
new RequestAnimationFrame()
The callback to be invoked each step.
The delay rate in ms for setTimeOut.
True if RequestAnimationFrame is running, otherwise false.
True if the step is using setTimeout instead of RAF.
The RAF step function.
Invokes the callback and schedules another call to requestAnimationFrame.
The SetTimeout step function.
Invokes the callback and schedules another call to setTimeout.
The setTimeout or RAF callback ID used when canceling them.
Stops the step from running and clears the callback reference.
Starts the requestAnimationFrame or setTimeout process running.
name | type | description |
---|---|---|
callback | FrameRequestCallback |
The callback to invoke each step. |
forceSetTimeOut | boolean |
Should it use SetTimeout, even if RAF is available? |
delay | number |
The setTimeout delay rate in ms. |
Stops the requestAnimationFrame or setTimeout from running.