Jump to content

sound fade in to custom volume


nak3ddogs
 Share

Recommended Posts

hi!

the sound 

fadeIn(durationloop)

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...