Optional loadedListener: ((layer) => void | Promise<void>)Optional updatedListener: ((layer) => void | Promise<void>)Get layer width
Get layer height
Get output canvas
Current layer text
Current outline width in pixels.
Current outline colour as a CSS hex string (e.g. '#FF0000').
Current font family.
Current font size value (in the layer's fontUnit).
Current adjustWidth direction mode.
Whether automatic font shrinking to fit the layer width is enabled.
Add a renderer to this layer. It's constructed with the layer's own width/height, so callers pass only the class and its config - never dimensions.
the constructed, initialised renderer instance
const shaky = await layer.addRenderer('shaky', ShakyRenderer, { mode: 'decay' })
shaky.triggerShake()
Pause a renderer without destroying it. The instance is kept and can be re-enabled with activateRenderer. Order in the queue is preserved.
Renderer id to deactivate. No-op if not found or already inactive.
Re-enable a previously deactivated renderer, restoring it at its original
position in the queue. The renderer must have been registered via the
constructor renderers dict or addRenderer.
Renderer id to activate.
if the renderer is not registered on this layer.
Animate layer opacity from its current value to 1 (fully opaque).
fade duration in ms
easing function (defaults to easeOutSine)
resolves when the fade completes
Animate layer opacity from its current value to 0 (fully transparent).
fade duration in ms
easing function (defaults to easeOutSine)
resolves when the fade completes
Set layer text
Optional options: Options<OptionsObject>(if options is not an object drawText will use this._options)
Set how the adjustWidth-computed font size can change across setText() calls, then redraw. See TextLayerOptions.adjustDirection for the meaning of each value. Resets any previously remembered shrink/grow size.
Current layer opacity (0 to 1)