Fork me on GitHub
View source

package haxepunk.tweens.sound

class SfxFader


extends Tween

Sound effect fader.

Constructor

View source

new (sfx : Sfx, type : TweenType) : Void

Constructor.


Parameters:
sfx   

The Sfx object to alter.

complete   

Optional completion callback.

type   

Tween type.

Variables

read only sfx : Sfx

The current Sfx this object is effecting.

Functions

View source

crossFade (play : Sfx, loop : Bool, duration : Float, volume : Float = 1, ease : EaseFunction) : Void

Fades out the Sfx, while also playing and fading in a replacement Sfx.


Parameters:
play   

The Sfx to play and fade in.

loop   

If the new Sfx should loop.

duration   

Duration of the crossfade.

volume   

The volume to fade in the new Sfx to.

ease   

Optional easer function.

View source

fadeTo (volume : Float, duration : Float, ease : EaseFunction) : Void

Fades the Sfx to the target volume.


Parameters:
volume   

The volume to fade to.

duration   

Duration of the fade.

ease   

Optional easer function.