Skip to content

WasmGPU.createAnnotation.toolkit().setMode

Summary

WasmGPU.createAnnotation.toolkit().setMode changes annotation interaction mode. Changing mode clears current staging anchors before applying the new mode.

Syntax

WasmGPU.createAnnotation.toolkit().setMode(mode: AnnotationMode): this
toolkit.setMode(mode);

Parameters

Name Type Required Description
mode AnnotationMode Yes Target interaction mode: idle, marker, distance, or angle.

Returns

this - Returns the same toolkit.

Type Details

type AnnotationMode = "idle" | "marker" | "distance" | "angle";

Example

const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const toolkit = wgpu.createAnnotation.toolkit({ canvas });

toolkit.setMode("distance");

See Also