pixijs-html-source

安装量: 1.3K
排名: #5973

安装

npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-html-source

HTMLSource and ElementImageSource turn a DOM element into a TextureSource you can use anywhere a normal texture works: on a Sprite , as a Texture frame, or mapped onto a Mesh . HTMLSource mirrors a live element's pixels into the GPU (the element stays editable and clickable in the browser); ElementImageSource wraps an immutable snapshot that never repaints. Both require a side-effect import 'pixi.js/html-source' to register their extensions. These sources rely on the experimental HTML-in-Canvas browser proposal and are marked EXPERIMENTAL in PixiJS v8. The browser API must be enabled or the texture uploader throws on first render; feature-detect with canvas.requestPaint before relying on it. The API may change between minor releases. Assumes familiarity with pixijs-scene-sprite and textures. These are texture sources , not display objects: wrap them in a Sprite (or Texture / Mesh ) to put them on screen. Not available in Web Workers; a worker has no DOM to capture. Quick Start import "pixi.js/html-source" ; import { Application , Sprite } from "pixi.js" ; import { HTMLSource } from "pixi.js/html-source" ; const app = new Application ( ) ; await app . init ( { resizeTo : window } ) ; document . body . appendChild ( app . canvas ) ; Show more Installs 563 Repository pixijs/pixijs-skills GitHub Stars 245 First Seen Jun 4, 2026 Security Audits Gen Agent Trust Hub Pass Socket Pass Snyk Pass

返回排行榜