Skip to content

Commit 598356d

Browse files
authored
Merge pull request phaserjs#5048 from samme/docs/PackFileSection
Add Phaser.Types.Loader.FileTypes.PackFileSection
2 parents ab7b7b1 + 037d3f1 commit 598356d

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @typedef {object} Phaser.Types.Loader.FileTypes.PackFileSection
3+
*
4+
* @property {Phaser.Types.Loader.FileConfig[]} files - The files to load. See {@link Phaser.Types.Loader.FileTypes}.
5+
* @property {string} [baseURL] - A URL used to resolve paths in `files`. Example: 'http://labs.phaser.io/assets/'.
6+
* @property {string} [defaultType] - The default {@link Phaser.Types.Loader.FileConfig} `type`.
7+
* @property {string} [path] - A URL path used to resolve relative paths in `files`. Example: 'images/sprites/'.
8+
* @property {prefix} [prefix] - An optional prefix that is automatically prepended to each file key.
9+
*
10+
* @example
11+
* var packFileSection = {
12+
* "prefix": "TEST2.",
13+
* "path": "assets/pics",
14+
* "defaultType": "image",
15+
* "files": [
16+
* {
17+
* "key": "donuts",
18+
* "extension": "jpg"
19+
* },
20+
* {
21+
* "key": "ayu"
22+
* }
23+
* ]
24+
* }
25+
* // Result:
26+
* // --------------------------------------------
27+
* // assets/pics/ayu.png -> image TEST2.ayu
28+
* // assets/pics/donuts.jpg -> image TEST2.donuts
29+
*/

src/scene/typedefs/SettingsConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @property {string} [key] - The unique key of this Scene. Must be unique within the entire Game instance.
66
* @property {boolean} [active=false] - Does the Scene start as active or not? An active Scene updates each step.
77
* @property {boolean} [visible=true] - Does the Scene start as visible or not? A visible Scene renders each step.
8-
* @property {(false|Phaser.Types.Loader.FileTypes.PackFileConfig)} [pack=false] - An optional Loader Packfile to be loaded before the Scene begins.
8+
* @property {(false|Phaser.Types.Loader.FileTypes.PackFileSection)} [pack=false] - Files to be loaded before the Scene begins.
99
* @property {?(Phaser.Types.Cameras.Scene2D.JSONCamera|Phaser.Types.Cameras.Scene2D.JSONCamera[])} [cameras=null] - An optional Camera configuration object.
1010
* @property {Object.<string, string>} [map] - Overwrites the default injection map for a scene.
1111
* @property {Object.<string, string>} [mapAdd] - Extends the injection map for a scene.

src/scene/typedefs/SettingsObject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @property {integer} transitionDuration - The duration of the transition, if set.
1313
* @property {boolean} transitionAllowInput - Is this Scene allowed to receive input during transitions?
1414
* @property {object} data - a data bundle passed to this Scene from the Scene Manager.
15-
* @property {(false|Phaser.Types.Loader.FileTypes.PackFileConfig)} pack - The Loader Packfile to be loaded before the Scene begins.
15+
* @property {(false|Phaser.Types.Loader.FileTypes.PackFileSection)} pack - Files to be loaded before the Scene begins.
1616
* @property {?(Phaser.Types.Cameras.Scene2D.JSONCamera|Phaser.Types.Cameras.Scene2D.JSONCamera[])} cameras - The Camera configuration object.
1717
* @property {Object.<string, string>} map - The Scene's Injection Map.
1818
* @property {Phaser.Types.Core.PhysicsConfig} physics - The physics configuration object for the Scene.

0 commit comments

Comments
 (0)