Method | Description | |
---|---|---|
dispose ( ) : void |
Disposes of all resources contained in BGMusic. Call this method at the end of the Game's life.
|
|
fadeIn ( ) : void |
Song starts from silence and fades in to full volume. Default fade in time.
|
|
fadeIn ( double fadeTime ) : void |
Song starts from silence and fades in to full volume
|
|
fadeOut ( ) : void |
Song starts from full volume and fades out to silence. Default fade out time.
|
|
fadeOut ( double fadeTime ) : void |
Song starts from full volume and fades out to silence
|
|
isLooping ( ) : bool |
Specifies whether a song is looping (true by default)
|
|
isPaused ( ) : bool |
Specifies whether the soundtrack is paused (false if is playing)
|
|
playSong ( string fileName ) : void |
Begins playing a song with the specified file name. Only .mp3, .wma, and .m4a are supported.
|
|
setLooping ( bool looping ) : void |
Sets whether a song should loop upon ending (true by default)
|
|
setPaused ( bool pause ) : void |
Sets whether the soundtrack is paused or not
|
|
setVolume ( float volume ) : void |
Changes the volume of playback; BGMusic.SILENCE can be used for muting the song, while BGMusic.FULL_VOLUME can unmute.
|
|
stopSong ( ) : void |
Stops song and disposes of it (cannot be resumed afterward)
|
|
transitionToSong ( string fileName ) : void |
Fades out the current song and starts playing the new song after a short lag. Default fade time and lag times are used.
|
|
transitionToSong ( string fileName, double fadeTime, double lagTime ) : void |
Fades out the current song and starts playing the new song after a short lag
|
|
transitionToSongWithFadeIn ( string fileName ) : void |
Fades out the current song and starts fading into the new song after a short lag. Default fade and lag times are used.
|
|
transitionToSongWithFadeIn ( string fileName, double fadeTime, double lagTime ) : void |
Fades out the current song and starts fading into the new song after a short lag
|
Method | Description | |
---|---|---|
OnFadeOver ( object source, System.Timers.ElapsedEventArgs e ) : void | ||
OnFadeOverFadeIn ( object source, System.Timers.ElapsedEventArgs e ) : void | ||
tryAllFileTypes ( string fileName ) : bool |
public static fadeIn ( double fadeTime ) : void | ||
fadeTime | double | Time to fade in, in milliseconds |
return | void |
public static fadeOut ( double fadeTime ) : void | ||
fadeTime | double | Time to fade out, in milliseconds |
return | void |
public static playSong ( string fileName ) : void | ||
fileName | string | File name of the song in the "Content" directory |
return | void |
public static setLooping ( bool looping ) : void | ||
looping | bool | True if the song should loop, false otherwise |
return | void |
public static setPaused ( bool pause ) : void | ||
pause | bool | |
return | void |
public static setVolume ( float volume ) : void | ||
volume | float | |
return | void |
public static transitionToSong ( string fileName ) : void | ||
fileName | string | File name of the new song to play in the "Content" folder |
return | void |
public static transitionToSong ( string fileName, double fadeTime, double lagTime ) : void | ||
fileName | string | File name of the new song to play in the "Content" folder |
fadeTime | double | Time to fade out, in milliseconds |
lagTime | double | Lag time between the two songs (excluding fade time), in milliseconds |
return | void |
public static transitionToSongWithFadeIn ( string fileName ) : void | ||
fileName | string | File name of the new song to play in the "Content" folder |
return | void |
public static transitionToSongWithFadeIn ( string fileName, double fadeTime, double lagTime ) : void | ||
fileName | string | File name of the new song to play in the "Content" folder |
fadeTime | double | Time to fade out and fade in (each), in milliseconds |
lagTime | double | Lag time between the two songs (excluding fade time), in milliseconds |
return | void |