Skip to content

Commit f28bc82

Browse files
committed
Fixed packfiles undefined path error.
1 parent f15fe67 commit f28bc82

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

src/loader/Loader.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,17 @@ Phaser.Loader.prototype = {
584584
/**
585585
* Add a JSON resource pack ('packfile') to the Loader.
586586
*
587-
* Packs are always put before the first non-pack file that is not loaded/loading.
587+
* A packfile is a JSON file that contains a list of assets to the be loaded.
588+
* Please see the example 'loader/asset pack' in the Phaser Examples repository.
589+
*
590+
* Packs are always put before the first non-pack file that is not loaded / loading.
591+
*
588592
* This means that all packs added before any loading has started are added to the front
589-
* of the file/asset list, in order added.
593+
* of the file queue, in the order added.
594+
*
595+
* The key must be a unique String. It is used to add the file to the Phaser.Cache upon successful load.
596+
*
597+
* The URL of the packfile can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.
590598
*
591599
* @method Phaser.Loader#pack
592600
* @param {string} key - Unique asset key of this resource pack.
@@ -612,6 +620,7 @@ Phaser.Loader.prototype = {
612620
type: 'packfile',
613621
key: key,
614622
url: url,
623+
path: this.path,
615624
syncPoint: true,
616625
data: null,
617626
loading: false,
@@ -1939,6 +1948,10 @@ Phaser.Loader.prototype = {
19391948
case "atlas":
19401949
this.atlas(file.key, file.textureURL, file.atlasURL, file.atlasData, Phaser.Loader[file.format]);
19411950
break;
1951+
1952+
case "shader":
1953+
this.shader(file.key, file.url, file.overwrite);
1954+
break;
19421955
}
19431956
}
19441957

0 commit comments

Comments
 (0)