The callback to be invoked each step.
The delay, in milliseconds, between each step when using 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.
The callback to invoke each step.
Should it use SetTimeout, even if RAF is available?
The delay, in milliseconds, between each step when using setTimeout.
Stops the requestAnimationFrame or setTimeout from running.
Abstracts away the use of
requestAnimationFrameorsetTimeoutfor the core game update loop, providing a unified interface regardless of which mechanism is in use.When
requestAnimationFrameis available and not overridden, it is used to drive the game loop, which ties updates to the display refresh rate and pauses automatically when the tab is hidden. IfforceSetTimeOutis enabled in the Game Config,setTimeoutis used instead, which runs at a fixed interval regardless of visibility or display sync.This class is instantiated and managed automatically by the Phaser.Game instance.