pixijs-scene-dom-container

Synchronize HTML element overlays with PixiJS scene graph transforms via DOMPipe.

16|8|Updated May 20, 2020
One-click install
npx skills add https://github.com/encounterplus/web-client --skill pixijs-scene-dom-container-encounterplus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixijs-scene-dom-container
Source: https://github.com/encounterplus/web-client/tree/main/.agents/skills/pixijs-scene-dom-container
Command: npx skills add https://github.com/encounterplus/web-client --skill pixijs-scene-dom-container-encounterplus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the challenge of aligning rich, interactive HTML elements with PixiJS display objects so your DOM-based UI stays perfectly synced with the canvas scene as it moves, scales, rotates, and changes visibility.

Core Features & Use Cases

  • Scene-graph-driven DOM positioning: Use a DOMContainer to map a PixiJS object's transform into CSS transforms for an overlaid HTML element.
  • Element anchoring for precise UI placement: Position DOM overlays relative to a configurable anchor (top-left, center, bottom-right, or custom).
  • Correct rendering and input behavior: Keep canvas and DOM interaction predictable by controlling pointer-events, syncing visible state, and relying on the PixiJS DOMPipe integration.
  • Use case: Render native inputs, iframes, or video overlays that follow sprites in a game or visualization without writing custom transform glue code.

Quick Start

Use import "pixi.js/dom" then create a DOMContainer with an HTMLElement, set its anchor, position it in the PixiJS scene, and add it to app.stage to get a live HTML overlay.

Frequently Asked Questions about pixijs-scene-dom-container

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I overlay HTML elements on a PixiJS scene graph?

To overlay HTML elements on a PixiJS scene graph, use a DOMContainer to map PixiJS display object transforms into CSS transforms, keeping interactive UI perfectly synced with the canvas as it moves, scales, and rotates.

How do I keep a DOM overlay positioned correctly when a PixiJS sprite moves?

Keeping a DOM overlay positioned correctly requires syncing HTML elements with PixiJS scene graph transforms via the DOMPipe, which automatically applies the sprite's movement, scaling, and rotation to the overlay's CSS transforms.

Can I use native HTML inputs and iframes inside a PixiJS v8 scene?

Yes, you can use native HTML inputs and iframes inside a PixiJS v8 scene by creating a DOMContainer, adding the HTMLElement to the PixiJS stage, and letting the DOMPipe handle the native input overlay rendering alongside the canvas.

Do I need to manually set pointer-events for DOM overlays in PixiJS?

You do not need to manually set pointer-events for DOM overlays in PixiJS, because the DOMContainer integration automatically handles pointer-events behavior to ensure DOM interactions work reliably alongside canvas rendering.

How do I anchor a UI overlay to a specific point on a PixiJS display object?

To anchor a UI overlay to a specific point on a PixiJS display object, set the configurable anchor property on the DOMContainer to position the DOM overlay relative to top-left, center, bottom-right, or custom coordinates.

How do I set up HTML overlays to render correctly in PixiJS v8?

HTML overlays render correctly in PixiJS v8 by ensuring the root environment includes `import "pixi.js/dom"` or equivalent pipe registration, which activates the DOMPipe to sync element visibility and positioning with the scene graph.