We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a548e4d commit d8eb945Copy full SHA for d8eb945
1 file changed
v3/src/sound/BaseSoundManager.js
@@ -162,6 +162,15 @@ var BaseSoundManager = new Class({
162
sound.play();
163
}
164
},
165
+ /**
166
+ * Enables playing audio sprite sound on the fly without the need to keep a reference to it.
167
+ * Sound will auto destroy once its playback ends.
168
+ *
169
+ * @method Phaser.Sound.BaseSoundManager#playAudioSprite
170
+ * @param {string} key - Asset key for the sound.
171
+ * @param {string} spriteName - The name of the sound sprite to play.
172
+ * @param {ISoundConfig} [config] - An optional config object containing default sound settings.
173
+ */
174
playAudioSprite: function (key, spriteName, config) {
175
var sound = this.addAudioSprite(key);
176
sound.events.once('SOUND_ENDED', sound.destroy.bind(sound));
0 commit comments