Experimental AdvancedOptional ExperimentalautoAutomatically set the layoutsubtree attribute on the owning canvas. The browser only
lays out and paints canvas children when this attribute is present.
Optional ExperimentalautoRequest an initial paint after construction. Set to false and call
HTMLSource.requestPaint yourself each frame for continuous animations.
Optional ExperimentalautoListen for the owning canvas' paint event and update this source when the element is
repainted. Disable for a static, captured-once texture.
Optional ExperimentalcanvasThe canvas that owns this element's layout subtree. When omitted, this is inferred from
resource.parentElement when the resource is a direct canvas child.
// Inferred automatically — domElement is appended to the Pixi canvas.
app.canvas.appendChild(domElement);
const source = new HTMLSource({ resource: domElement });
// Passed explicitly when inference is not possible.
const explicit = new HTMLSource({
resource: domElement,
canvas: app.canvas as HTMLSourceCanvas,
});
Options for creating an HTMLSource. Configures how the source binds to its owning canvas and when it repaints.
Example
See
HTMLSource For the texture source these options configure