Skip to content

Commit 4e7fad3

Browse files
committed
Loader.audiosprite is renamed to Loader.audioSprite (the old one still works for legacy reasons) (thanks @epaezrubio phaserjs#2145)
1 parent ecb68c2 commit 4e7fad3

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
300300
* Moved the Sound.disconnect after the Sound.stop call in Web Audio (#2280)
301301
* BitmapData.drawGroup can now handle drawing Emitters and BitmapText objects that are part of the Group.
302302
* SoundManager.setTouchLock is no longer set if `SoundManager.noAudio` is true, or if the PhaserGlobal setting `disableAudio` is true (thanks @bcjordan #2206)
303+
* Loader.audiosprite is renamed to Loader.audioSprite (the old one still works for legacy reasons) (thanks @epaezrubio #2145)
303304

304305
### Bug Fixes
305306

src/loader/Loader.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ Phaser.Loader.prototype = {
10321032
* Audio files can't be played until they are decoded and, if specified, this enables immediate decoding. Decoding is a non-blocking async process, however it consumes huge amounts of CPU time on mobiles especially.
10331033
* @return {Phaser.Loader} This Loader instance.
10341034
*/
1035-
audiosprite: function(key, urls, jsonURL, jsonData, autoDecode) {
1035+
audioSprite: function (key, urls, jsonURL, jsonData, autoDecode) {
10361036

10371037
if (this.game.sound.noAudio)
10381038
{
@@ -1067,6 +1067,23 @@ Phaser.Loader.prototype = {
10671067

10681068
},
10691069

1070+
/**
1071+
* A legacy alias for Loader.audioSprite. Please see that method for documentation.
1072+
*
1073+
* @method Phaser.Loader#audiosprite
1074+
* @param {string} key - Unique asset key of the audio file.
1075+
* @param {Array|string} urls - An array containing the URLs of the audio files, i.e.: [ 'audiosprite.mp3', 'audiosprite.ogg', 'audiosprite.m4a' ] or a single string containing just one URL.
1076+
* @param {string} [jsonURL=null] - The URL of the audiosprite configuration JSON object. If you wish to pass the data directly set this parameter to null.
1077+
* @param {string|object} [jsonData=null] - A JSON object or string containing the audiosprite configuration data. This is ignored if jsonURL is not null.
1078+
* @param {boolean} [autoDecode=true] - When using Web Audio the audio files can either be decoded at load time or run-time.
1079+
* Audio files can't be played until they are decoded and, if specified, this enables immediate decoding. Decoding is a non-blocking async process, however it consumes huge amounts of CPU time on mobiles especially.
1080+
* @return {Phaser.Loader} This Loader instance.
1081+
*/
1082+
audiosprite: function (key, urls, jsonURL, jsonData, autoDecode) {
1083+
1084+
return this.audioSprite(key, urls, jsonURL, jsonData, autoDecode);
1085+
1086+
},
10701087

10711088
/**
10721089
* Adds a video file to the current load queue.

0 commit comments

Comments
 (0)