pixijs-environments

安装量: 790
排名: #5001

安装

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

DOMAdapter abstracts every piece of DOM access PixiJS does (canvas creation, Image loading, fetch, XML parsing) so the library can run in non-browser contexts. Call DOMAdapter.set(...) before app.init() to swap in a different adapter. Quick Start // worker.ts — OffscreenCanvas posted from main thread DOMAdapter . set ( WebWorkerAdapter ) ; self . onmessage = async ( event ) => { const app = new Application ( ) ; await app . init ( { canvas : event . data . canvas , width : 800 , height : 600 , } ) ; } ; For CSP contexts that block unsafe-eval , import the polyfill before any renderer init: import "pixi.js/unsafe-eval" ;

返回排行榜