Experimental AdvancedOptional ExperimentalautoAutomatically set content="drawable" on the owning canvas, plus the layoutsubtree
attribute that Chrome versions before 155 expect. The browser only lays out and paints
canvas descendants when it 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. It must be the resource's nearest <canvas> ancestor,
or the constructor throws. Leave it out and it's inferred.
// Inferred automatically — domElement is appended to the Pixi canvas.
app.canvas.appendChild(domElement);
const source = new HTMLSource({ resource: domElement });
// Equivalent: the same canvas, passed explicitly.
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