API

Interface IHtmlTextureOptions

Defines the options used to create an HtmlTexture.

interface IHtmlTextureOptions {
    autoUpdate?: boolean;
    engine?: Nullable<AbstractEngine>;
    format?: number;
    generateMipMaps?: boolean;
    height?: number;
    samplingMode?: number;
    scene?: Nullable<Scene>;
    useSvgFallback?: boolean;
    width?: number;
}
Index
autoUpdate?: boolean

Defines whether the texture is automatically updated when the host canvas emits a paint event (default: true).

Defines the engine instance to use the texture with. Not mandatory if a scene is provided.

format?: number

Defines the associated texture format (default: TEXTUREFORMAT_RGBA).

generateMipMaps?: boolean

Defines whether mip maps should be created or not (default: false).

height?: number

Defines the height of the texture in pixels (defaults to the element's offset height, then 256).

samplingMode?: number

Defines the sampling mode of the texture (default: TEXTURE_BILINEAR_SAMPLINGMODE).

scene?: Nullable<Scene>

Defines the scene the texture belongs to. Not mandatory if an engine is provided.

useSvgFallback?: boolean

Defines whether to fall back to an SVG <foreignObject> rasterization when the native WICG HTML-in-Canvas API is unavailable (default: true). The fallback works in any browser but only captures same-origin, inline-styled content as a static snapshot (see the documentation for caveats).

width?: number

Defines the width of the texture in pixels (defaults to the element's offset width, then 256).