You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ The Loader has been given an overhaul to improve its performance and extensibili
24
24
* If you used a Scene files payload then the format of the object has changed. It used to be a property in the Scene Config called `files` which was an array of files to load. It has been renamed to `pack` and it's an object that exactly matches the new Pack File format. Please see the loader example `scene files payload.js` for an example. In short, where you had: `files: []` before, just change it to `pack: { files: [] }` and it'll work.
25
25
* The Loader now supports Texture Atlases with normal maps. Before it would only support single images loaded with normal maps, but now you can provide them for all the atlas formats (json, xml and Unity)
26
26
* The Loader `multiatlas` feature will now automatically load texture normal maps, if specified in the json.
27
+
* Binary Files have a new optional `dataType` argument and property which will cast the binary data to that format after load, before inserting it into the cache, i.e.: `load.binary('mod', 'music.mod', Uint8Array)`
Copy file name to clipboardExpand all lines: src/loader/filetypes/BinaryFile.js
+14-5Lines changed: 14 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
18
18
* @property {string} [url] - The absolute or relative URL to load the file from.
19
19
* @property {string} [extension='bin'] - The default file extension to use if no url is provided.
20
20
* @property {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.
21
+
* @property {any} [dataType] - Optional type to cast the binary file to once loaded. For example, `Uint8Array`.
21
22
*/
22
23
23
24
/**
@@ -38,14 +39,15 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
38
39
* @param {(string|Phaser.Loader.FileTypes.BinaryFileConfig)} key - The key to use for this file, or a file configuration object.
39
40
* @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `<key>.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin".
40
41
* @param {XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.
42
+
* @param {any} [dataType] - Optional type to cast the binary file to once loaded. For example, `Uint8Array`.
@@ -140,11 +148,12 @@ var BinaryFile = new Class({
140
148
*
141
149
* @param {(string|Phaser.Loader.FileTypes.BinaryFileConfig|Phaser.Loader.FileTypes.BinaryFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.
142
150
* @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `<key>.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin".
151
+
* @param {any} [dataType] - Optional type to cast the binary file to once loaded. For example, `Uint8Array`.
143
152
* @param {XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.
144
153
*
145
154
* @return {Phaser.Loader.LoaderPlugin} The Loader instance.
0 commit comments