尝试使用 Phaser 和 TexturePacker 中的多图集功能。
出现此错误:
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-sd.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'
});
The 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
}
},
我尝试过各种组合path
and baseURL
settings https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html#multiatlas__anchor但它不会加载文件dist/img
.