pixi.js
    Preparing search index...

    Interface HTMLSourceCanvasExperimental Advanced

    An HTMLCanvasElement extended with the experimental HTML-in-Canvas proposal APIs.

    These members only exist in browsers that have the HTML-in-Canvas feature enabled, so they are optional. HTMLSource feature-detects requestPaint; the HTML-in-Canvas API must be enabled for the texture to upload.

    import type { HTMLSourceCanvas } from 'pixi.js/html-source';

    const canvas = app.canvas as HTMLSourceCanvas;

    // Feature-detect before relying on the experimental API.
    if (canvas.requestPaint)
    {
    canvas.requestPaint();
    }
    • HTMLSource For the texture source that drives these APIs
    • ElementImage For the snapshot type captureElementImage() returns
    interface HTMLSourceCanvas {
        captureElementImage?: (element: Element) => ElementImage;
        requestPaint?: () => void;
    }

    Hierarchy

    Index

    Properties

    captureElementImage?: (element: Element) => ElementImage

    Captures the current rendered pixels of element into an immutable ElementImage.

    requestPaint?: () => void

    Requests a paint event so the canvas re-snapshots its layoutsubtree children.