The main WebAssembly controller class. Handles interaction between JavaScript and the compiled C++ core of Micrio. Accessed via micrio.wasm.

Constructors

  • Creates the Wasm controller instance.

    Parameters

    Returns Wasm

Properties

The main HTMLMicrioElement instance.

ready: boolean = false

Flag indicating if the Wasm module has been loaded and initialized.

Methods

  • Add a child independent canvas to the current canvas, used for grid images

    Parameters

    Returns Promise<void>

    Promise when the image is added

  • Loads and instantiates the WebAssembly module.

    Returns Promise<void>

    A Promise that resolves when the Wasm module is ready.

  • Removes a canvas instance from the Wasm module.

    Parameters

    Returns void

  • Requests the next animation frame to trigger the draw method.

    Returns void

  • Sets the currently active canvas/image instance in the Wasm module. Handles adding the canvas to Wasm if it's not already initialized.

    Parameters

    • Optionalcanvas: MicrioImage

      The MicrioImage instance to set as active.

    Returns void

  • Unbinds event listeners, stops rendering, and cleans up resources.

    Returns void