DOMContainer positions an HTML element over the PixiJS canvas and drives its CSS transform from the scene graph. Use it for native inputs, iframes, videos, or rich HTML that needs to follow a display object's position. The default pixi.js browser bundle registers the DOMPipe automatically; custom builds add a side-effect import 'pixi.js/dom' . DOMContainer is marked EXPERIMENTAL in PixiJS v8. The API may change between minor releases. Assumes familiarity with pixijs-scene-core-concepts . DOMContainer extends ViewContainer , so it's a leaf: do not nest PixiJS children inside it. Nest DOM content inside the HTML element itself, or wrap multiple DOMContainer instances in a Container . Not available in Web Workers; a worker has no DOM to overlay. Quick Start import "pixi.js/dom" ; const input = document . createElement ( "input" ) ; input . type = "text" ; input . placeholder = "Enter name..." ; const dom = new DOMContainer ( { element : input , anchor : 0.5 , } ) ; dom . position . set ( app . screen . width / 2 , app . screen . height / 2 ) ; app . stage . addChild ( dom ) ;
pixijs-scene-dom-container
安装
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-scene-dom-container