Canvas manager

Constructors

Properties

element?: HTMLCanvasElement

The particles canvas

The particles canvas dimension

Methods

  • Generic draw method, for drawing stuff on the canvas context

    Type Parameters

    • T

    Parameters

    • cb: ((context: CanvasRenderingContext2D) => T)
        • (context): T
        • Parameters

          • context: CanvasRenderingContext2D

          Returns T

    Returns undefined | T

    the result of the callback

  • Type Parameters

    • T

    Parameters

    • cb: ((context: CanvasRenderingContext2D) => T)
        • (context): T
        • Parameters

          • context: CanvasRenderingContext2D

          Returns T

    Returns undefined | T

  • Draws the specified particle in the canvas

    Parameters

    • particle: Particle

      the particle to draw

    • delta: IDelta

      the frame delta time values

    Returns void

  • Draws stuff using the given plugin, using the given particle

    Parameters

    Returns void

  • Draws stuff using the given plugin

    Parameters

    Returns void

  • Initializes the canvas element

    Returns Promise<void>

  • Initializes the canvas background

    Returns void

  • Initializes the plugins needed by canvas

    Returns void

  • Initializes the updaters needed by canvas

    Returns void

  • Loads the canvas html element

    Parameters

    • canvas: HTMLCanvasElement

      the canvas html element

    Returns void

  • Calculates the size of the canvas

    Returns boolean

    true if the size changed

  • The window resize event handler

    Returns Promise<void>