Class GLSLShaderEntity<T>

Type Parameters

Implements

Constructors

Properties

action?: ((time: number, shaderRender: GLSLShaderRenderer, properties: IGLSLShaderProperties, sequence?: Sequence, entity?: GLSLShaderEntity<T>) => void)

An optional action function to be called before rendering the shaders.

barListeners?: ((time: number, count: number, propertyBag: T) => void)[] = []
beatListeners?: ((time: number, count: number, propertyBag: T) => void)[] = []
canvas: HTMLCanvasElement
durationInMs?: number
h?: number

The height of the entity's canvas.

name: string

The key or identifier for the entity.

props?: T

The properties for the entity, including shader code and render buffers.

scene?: Scene
shaderRenderer: GLSLShaderRenderer
startTimeinMs?: number
tickListeners?: ((time: number, count: number, propertyBag: T) => void)[] = []
transitionIn?: ((ctx: CanvasRenderingContext2D, progress: number) => void)
transitionOut?: ((ctx: CanvasRenderingContext2D, progress: number) => void)
w?: number

The width of the entity's canvas.

Methods

  • Adds a post-processing function to the entity.

    Parameters

    • processor: ((ctx: CanvasRenderingContext2D, sequence: Sequence) => void)

      The post-processing function to add.

        • (ctx, sequence): void
        • Parameters

          • ctx: CanvasRenderingContext2D
          • sequence: Sequence

          Returns void

    Returns void

  • Adds an event listener for when a bar is complete.

    Type Parameters

    • T

    Parameters

    • listener: ((ts: number, count: number, propertyBag?: T) => void)

      The function to call when a bar is complete.

        • (ts, count, propertyBag?): void
        • Parameters

          • ts: number
          • count: number
          • OptionalpropertyBag: T

          Returns void

    Returns this

    The Entity instance for chaining.

  • Adds an event listener for when a beat occurs.

    Type Parameters

    • T

    Parameters

    • listener: ((time: number, count: number, propertyBag?: T) => void)

      The function to call when a beat occurs.

        • (time, count, propertyBag?): void
        • Parameters

          • time: number
          • count: number
          • OptionalpropertyBag: T

          Returns void

    Returns this

    The Entity instance for chaining.ยง

  • Adds an event listener for when a tick occurs.

    Type Parameters

    • T

    Parameters

    • listener: ((time: number, count: number, propertyBag?: T) => void)

      The function to call when a tick occurs.

        • (time, count, propertyBag?): void
        • Parameters

          • time: number
          • count: number
          • OptionalpropertyBag: T

          Returns void

    Returns this

    The Entity instance for chaining.

  • Updates the ShaderEntity by calling the action function (if provided) and then updating the ShaderRenderer.

    Parameters

    • timeStamp: number

      The current timestamp in the animation.

    Returns void