qq_54065101 2023-04-19 14:49 采纳率: 0%
浏览 26

关于pixiloader访问不到的问题有知道的吗

为什么在PIXI的身上访问不到loader?

img


这是版本

img

这是打印结果

img

  • 写回答

2条回答 默认 最新

  • 崽崽的谷雨 2023-04-19 14:55
    关注

    PIXI打印一下看看

    <template>
      <div ref="appContainer"></div>
    </template>
    
    
    import * as PIXI from 'pixi.js';
    import { onMounted, onUnmounted, ref } from 'vue';
    export default {
      setup() {
        let app = null;
        let scene = null;
        let sprite = null;
        const appContainer = ref(null);
        onMounted(() => {
          app = new PIXI.Application({
            width: 800,
            height: 600,
            backgroundColor: 0x1099bb
          });
          appContainer.value.appendChild(app.view);
          scene = new PIXI.Container();
          app.stage.addChild(scene);
          sprite = PIXI.Sprite.from('image.png');
          sprite.anchor.set(0.5);
          sprite.x = app.screen.width / 2;
          sprite.y = app.screen.height / 2;
          scene.addChild(sprite);
        });
        onUnmounted(() => {
          app.destroy(true);
        });
        return {
          appContainer,
          scene,
          sprite
        };
      }
    }
    
    
    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 4月19日