在React里面使用pixi.js 写出下面的代码就可以创建出一个全屏的pixi.js画布 const PixiCanvas = () => { const pixiContainerRef = useRef ( null ); useEffect (() => { const app = new PIXI . Application ({ resizeTo : window }) pixiContainerRef . current . appendChild ( app . view ); return () => { app . destroy ( true ); } }, []); return < div ref = { pixiContainerRef } /> ; } 加入一个container, 将背景图片挂载到这个container上面,然后加到场景pixijs app里面 useEffect (() => { const app = new PIXI . Application ({ resizeTo : window }); const container = new PIXI . Container (); // background image const backgroundTexture = PIXI . Texture . from ( backgroundImage ); const backgroundSprite = new PIXI . Sprite ( backgroundTexture ); const resizeBackground = () => { backgroundSprite . width = window . innerWidth ; backgroundSprite . height = window . inner...