mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
Defining detune property on a BaseSound class since it's the shared behaviour between subclasses
This commit is contained in:
parent
15f2717e9b
commit
2903417798
1 changed files with 16 additions and 0 deletions
|
@ -419,4 +419,20 @@ Object.defineProperty(BaseSound.prototype, 'rate', {
|
|||
this.events.dispatch(new SoundValueEvent(this, 'SOUND_RATE', value));
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Detuning of sound.
|
||||
*
|
||||
* @name Phaser.Sound.BaseSound#detune
|
||||
* @property {number} detune
|
||||
*/
|
||||
Object.defineProperty(BaseSound.prototype, 'detune', {
|
||||
get: function () {
|
||||
return this.currentConfig.detune;
|
||||
},
|
||||
set: function (value) {
|
||||
this.currentConfig.detune = value;
|
||||
this.setRate();
|
||||
this.events.dispatch(new SoundValueEvent(this, 'SOUND_DETUNE', value));
|
||||
}
|
||||
});
|
||||
module.exports = BaseSound;
|
||||
|
|
Loading…
Reference in a new issue