phaser - v4.0.0-rc.4
    Preparing search index...

    Class RequestAnimationFrame

    Abstracts away the use of RAF or setTimeOut for the core game update loop.

    This is invoked automatically by the Phaser.Game instance.

    Index

    Constructors

    Properties

    callback: FrameRequestCallback

    The callback to be invoked each step.

    delay: number

    The delay rate in ms for setTimeOut.

    isRunning: boolean

    True if RequestAnimationFrame is running, otherwise false.

    isSetTimeOut: boolean

    True if the step is using setTimeout instead of RAF.

    step: FrameRequestCallback

    The RAF step function.

    Invokes the callback and schedules another call to requestAnimationFrame.

    stepTimeout: Function

    The SetTimeout step function.

    Invokes the callback and schedules another call to setTimeout.

    timeOutID: number

    The setTimeout or RAF callback ID used when canceling them.

    Methods

    • Stops the step from running and clears the callback reference.

      Returns void

    • Starts the requestAnimationFrame or setTimeout process running.

      Parameters

      • 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.

      Returns void

    • Stops the requestAnimationFrame or setTimeout from running.

      Returns void