Function createHtmlTexture
-
createHtmlTexture(
engine: EngineContext,
element: HTMLElement,
options?: HtmlTexture2DOptions,
): HtmlTexture2DParameters
- engine: EngineContext
Engine context (must render into a DOM canvas, not an
OffscreenCanvas). - element: HTMLElement
The DOM element to rasterise.
- options: HtmlTexture2DOptions = {}
Size / sampler / update overrides.
Returns HtmlTexture2D
- engine: EngineContext
Create an HTML texture from a live
element. When an update path exists, the element is re-parented under the rendering canvas (restored on dispose), the texture is allocated blank, and — on the native path — apaintlistener is attached so the texture tracks the element. Reads as transparent black until the first paint uploads.