Add function to stop the current music
This commit is contained in:
parent
0b9c98dca4
commit
5601c63358
1 changed files with 10 additions and 0 deletions
|
@ -30,6 +30,16 @@ Music = (function() {
|
|||
currentMusic.volume = Music.volume;
|
||||
}
|
||||
|
||||
Music.stop = function() {
|
||||
if (!currentMusic) {
|
||||
return;
|
||||
}
|
||||
|
||||
currentMusic.stop();
|
||||
currentMusic.destroy();
|
||||
currentMusic = undefined;
|
||||
}
|
||||
|
||||
Music.fadeout = function(time) {
|
||||
if (!currentMusic) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue