Class VFX

The main interface of VFX-JS.

Constructors

Methods

  • Register an element to track the position and render visual effects in the area.

    Parameters

    Returns void

  • Remove the element from VFX and stop rendering the shader.

    Parameters

    • element: HTMLElement

    Returns void

  • Update the texture for the given element.

    If the element is an HTMLImageElemnt or HTMLVideoElement, VFX-JS does nothing.
    Otherwise, VFX-JS captures a new snapshot of the DOM tree under the elemnt and udpate the WebGL texture with it.

    This is useful to apply effects to eleents whose contents change dynamically (e.g. input, textare etc).

    Parameters

    • element: HTMLElement

    Returns Promise<void>