Skip to content

textmode.js / plugins / TextmodePluginContext / registerLayerPreRenderHook

Method: registerLayerPreRenderHook()

ts
registerLayerPreRenderHook(callback): () => void;

Register a callback to be invoked before each layer's render cycle. This happens after the layer's visibility check but before any drawing operations. Useful for rendering content to the layer's framebuffer before user draw callbacks.

Parameters

ParameterTypeDescription
callbackLayerRenderHookThe callback to invoke with the layer and render context.

Returns

A function to unregister the hook.

() => void

Example