收藏
回答

开发者工具可以显示图片,真机测试不显示图片

框架类型 问题类型 操作系统 工具版本
小游戏 Bug Windows RC 1.05.2109101

使用pixi.js 4.8.7

工程里所有的图片在开发者工具都能显示,但是在真机上测试不显示图片

里面是我想实现的图片拖拽的一部分内容

export default class Map{
    constructor(){
        this.mapImage = new PIXI.Sprite.fromImage('./img/map_00.png');
        this.container = new PIXI.Container();
        this.container.interactive = true;
        this.buttonMode = true;
        this.container
        .on('pointerdown', onDragStart)
        .on('pointerup', onDragEnd)
        .on('pointerupoutside', onDragEnd)
        .on('pointermove', onDragMove);
    }
    apply(){
        this.container.addChild(this.mapImage);
        return this.container;
    }
}

这里引用

    const theMap = new Map();
    const TheMapDia = theMap.apply();
    container.addChild(TheMapDia);

开发者工具里有图片

但是真机里没有

回答关注问题邀请回答
收藏

1 个回答

  • Forever
    Forever
    2021-09-28

    使用绝对路径看看,是否是ios手机,如果是图片大于2000*2000也是显示不出来的

    2021-09-28
    有用
    回复 1
    • 两千里
      两千里
      2022-05-11
      我的相对和绝对都用了,是ios,但是图片750*750,别的都是好的,就有两个图片咋弄出不来
      2022-05-11
      回复
登录 后发表内容