Skip to content

Commit a548e4d

Browse files
Added play method docs
1 parent bacce96 commit a548e4d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

v3/src/sound/BaseSoundManager.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ var BaseSoundManager = new Class({
138138
}
139139
return sound;
140140
},
141+
/**
142+
* Enables playing sound on the fly without the need to keep a reference to it.
143+
* Sound will auto destroy once its playback ends.
144+
*
145+
* @method Phaser.Sound.BaseSoundManager#play
146+
* @param {string} key - Asset key for the sound.
147+
* @param {ISoundConfig | ISoundMarker} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object.
148+
*/
141149
play: function (key, extra) {
142150
var sound = this.add(key);
143151
sound.events.once('SOUND_ENDED', sound.destroy.bind(sound));

0 commit comments

Comments
 (0)