Type Alias CanvasShaderType<T, C>

CanvasShaderType<T, C>: CoreShaderType<T> & {
    render: ((this: CanvasShaderNode<T, C>, ctx: CanvasRenderingContext2D, quad: QuadOptions, renderContext: (() => void)) => void);
    saveAndRestore?: boolean;
    update?: ((this: CanvasShaderNode<T, C>, node: CoreNode) => void);
}

Type Parameters

  • T extends object = Record<string, unknown>
  • C extends object = Record<string, unknown>

Type declaration

  • render: ((this: CanvasShaderNode<T, C>, ctx: CanvasRenderingContext2D, quad: QuadOptions, renderContext: (() => void)) => void)
      • (this, ctx, quad, renderContext): void
      • Parameters

        • this: CanvasShaderNode<T, C>
        • ctx: CanvasRenderingContext2D
        • quad: QuadOptions
        • renderContext: (() => void)
            • (): void
            • Returns void

        Returns void

  • OptionalsaveAndRestore?: boolean

    Set this to true when using ctx functions that scale, clip, rotate, etc..

  • Optionalupdate?: ((this: CanvasShaderNode<T, C>, node: CoreNode) => void)