[back to index]
Music.play(songname:String, ?offsettime:Float = 0.0, ?fadeintime:Float = 0, ?loop:Bool = true, ?panning:Float = 0)
Plays a song from data/sounds/ folder. Optionally set a startpoint (where 1.0 is 1 seconds into the song), a fade in time (0 means start immediately, 1.0 means fade in for one second), whether or not to loop, and a panning value (between -1 and +1 for left to right).
Music.stop(?fadeouttime:Float = 0)
Stop the currently playing song. Optionally set a fade out time (0 means stop immediately, 1.0 means fade out for one second)
A string containing the currently playing song. Blank if nothing is playing. You can check is a song is finished by checking if currentsong == "". Setting this value is the same as calling Music.play() with the default parameter values.
A float, telling us how far into the currently playing song we are. 2.5 means two and half seconds in, for example. Setting this value allows you to change the current position in the song.
Defaults to 0. Sets a crossfade value when changing songs. A value of 1.0 means crossfade between two songs for 1 second.