Options
All
  • Public
  • Public/Protected
  • All
Menu

The Dispatch API provides the means by which the game can manage the event loop.

Index

Functions

cancelAll

  • cancelAll(): void
  • Cancel all currently scheduled one-time jobs, excluding those scheduled with onExit. Recurring jobs are not affected.

    Returns void

later

  • later(numFrames: number, callback: function): JobToken
  • Schedule a one-time job to be run during a future frame.

    Parameters

    • numFrames: number

      How many frames to wait before firing.

    • callback: function

      A function to be called when the Dispatch job fires.

        • (): void
        • Returns void

    Returns JobToken

now

  • Schedule a one-time job to run during the current frame.

    Parameters

    • callback: function

      A function to be called when the Dispatch job fires.

        • (): void
        • Returns void

    Returns JobToken

onExit

  • Schedule a one-time job to run when the engine shuts down.

    Parameters

    • callback: function

      A function to be called when the Dispatch job fires.

        • (): void
        • Returns void

    Returns JobToken

onRender

  • Schedule a recurring job to run during the Render phase of each frame, before the backbuffer is flipped to the screen.

    Parameters

    • callback: function

      A non-async function to be called when the job fires.

        • (): void
        • Returns void

    • Optional options: JobOptions

      Scheduling options for this job.

    Returns JobToken

onUpdate

  • Schedule a recurring job to run during the Update phase of each frame. Use an async callback to spread an update over multiple frames.

    Parameters

    • callback: function

      A function to be called when the job fires.

        • (): void
        • Returns void

    • Optional options: JobOptions

      Scheduling options for this job.

    Returns JobToken

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc