Added volume event docs

This commit is contained in:
Pavle Goloskokovic 2018-01-26 15:06:33 +01:00
parent 5c5ddd88f5
commit a6c7e2da8b

View file

@ -458,6 +458,11 @@ Object.defineProperty(WebAudioSound.prototype, 'volume', {
set: function (value) { set: function (value) {
this.currentConfig.volume = value; this.currentConfig.volume = value;
this.volumeNode.gain.setValueAtTime(value, 0); this.volumeNode.gain.setValueAtTime(value, 0);
/**
* @event Phaser.Sound.WebAudioSound#volume
* @param {Phaser.Sound.WebAudioSound} sound - Reference to the sound that emitted event.
* @param {number} value - An updated value of Phaser.Sound.WebAudioSound#volume property.
*/
this.emit('volume', this, value); this.emit('volume', this, value);
} }
}); });