nak3ddogs Posted November 9, 2014 Share Posted November 9, 2014 hi!the sound fadeIn(duration, loop)look like a good option but is is unusable for me when i cant set the end volume. in the docs i not see option for that but in my game the player can set music volume.someway can i solve this problem?ty for any advice Link to comment Share on other sites More sharing options...
nak3ddogs Posted November 9, 2014 Author Share Posted November 9, 2014 Phaser.Sound.fadeIn.prototype = function (duration, loop, customVolume) { if (typeof duration === 'undefined') { duration = 1000; } if (typeof loop === 'undefined') { loop = false; } if (typeof customVolume=== 'undefined') { customVolume= 1; } if (this.paused) { return; } this.play('', 0, 0, loop); var tween = this.game.add.tween(this).to( { volume: customVolume }, duration, Phaser.Easing.Linear.None, true); tween.onComplete.add(this.fadeComplete, this); },is it possible? im rly newby. pls help with syntax Link to comment Share on other sites More sharing options...
Nick Posted November 10, 2014 Share Posted November 10, 2014 As of v2.1.3 there is now a fadeTo method: https://github.com/photonstorm/phaser/blob/master/src/sound/Sound.js#L837 nak3ddogs 1 Link to comment Share on other sites More sharing options...
nak3ddogs Posted November 14, 2014 Author Share Posted November 14, 2014 ty Link to comment Share on other sites More sharing options...
Recommended Posts