Json 在Phaser3中从Multiatlas加载文件时出错

Json 在Phaser3中从Multiatlas加载文件时出错,json,typescript,webpack,phaser-framework,texture-atlas,Json,Typescript,Webpack,Phaser Framework,Texture Atlas,尝试在Phaser和TexturePacker中使用multiatlas功能 获取此错误: VM32201:1 GET http://localhost:8080/bg-sd.json 404 (Not Found) Texture.js:250 Texture.frame missing: 1/1.png JSON文件实际上位于http://localhost:8080/dist/img/bg-json,我可以浏览到它。我也可以浏览到http://localhost:8080/dist/im

尝试在Phaser和TexturePacker中使用multiatlas功能

获取此错误:

VM32201:1 GET http://localhost:8080/bg-sd.json 404 (Not Found)
Texture.js:250 Texture.frame missing: 1/1.png
JSON文件实际上位于http://localhost:8080/dist/img/bg-json,我可以浏览到它。我也可以浏览到http://localhost:8080/dist/img/bg-1-sd.png

我正在加载地图册,就像:

    scene.load.multiatlas({
        key: 'bg-sd', 
        atlasURL: 'dist/img/bg-sd.json', 
        baseURL: 'dist/img'
    });
文件中还包含1/1.png帧:

{
    "textures": [
        {
            "image": "bg-1-sd.png",
            "format": "RGBA8888",
            "size": {
                "w": 1924,
                "h": 2039
            },
            "scale": 0.5,
            "frames": [
                {
                    "filename": "1/1.png",
                    "rotated": false,
                    "trimmed": false,
                    "sourceSize": {
                        "w": 960,
                        "h": 540
                    },
                    "spriteSourceSize": {
                        "x": 0,
                        "y": 0,
                        "w": 960,
                        "h": 540
                    },
                    "frame": {
                        "x": 1,
                        "y": 1,
                        "w": 960,
                        "h": 540
                    }
                },
我尝试了路径和baseURL的各种组合,但它不会从dist/img加载文件

我认为同时提供baseURL和atlasURL可能会有冲突。baseURL附加在atlasURL值前面,因此您可能正在加载类似dist/img/dist/img/bg-sd.json的内容

您是否尝试过不使用配置对象,例如:

this.load.multiatlas('bd-sd', './dist/img/bg-sd.json');

这是可行的,但只有当我在json文件中手动预加图像路径时。TexturePacker似乎有一个bug,即TexturePath属性未在mulitpack上使用。