Fork me on GitHub
View source

package com.haxepunk.tweens.sound

class SfxFader


extends Tween

Sound effect fader.

Constructor

View source

new (sfx : Sfx, complete : Dynamic ->Void, , 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 : Float ->Float, ) : 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 : Float ->Float, ) : Void

Fades the Sfx to the target volume.


Parameters:
volume   

The volume to fade to.

duration   

Duration of the fade.

ease   

Optional easer function.