#
luxiaotao1123
2024-03-01 1b02fcfb2a0655299a38ad99e2bcba2b95d4abe2
#
1个文件已修改
32 ■■■■ 已修改文件
zy-asrs-flow/src/pages/map/index.jsx 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/index.jsx
@@ -53,11 +53,33 @@
        };
        window.addEventListener('resize', handleResize);
        // app init
        app.stage.interactive = true;
        app.stage.hitArea = app.screen;
        globalThis.__PIXI_APP__ = app;
        mapRef.current.appendChild(app.view);
        setTimeout(() => {
            // app init
            app.stage.eventMode = 'auto';
            app.stage.hitArea = app.screen;
            globalThis.__PIXI_APP__ = app;
            mapRef.current.appendChild(app.view);
            // mapContainer ------------------------------
            const mapContainer = new PIXI.Container();
            mapContainer.name = "mapContainer";
            mapContainer.data = {};
            app.stage.addChild(mapContainer);
            const texture = PIXI.Texture.from('https://pixijs.com/assets/bunny.png');
            const bunny = new PIXI.Sprite(texture);
            bunny.anchor.set(0.5);
            console.log(app.screen);
            bunny.x = app.screen.width / 2;
            bunny.y = app.screen.height / 2;
            mapContainer.addChild(bunny);
            app.ticker.add((delta) => {
                bunny.rotation -= 0.01 * delta;
            });
        }, 300)
    }, []);
    React.useEffect(() => {