Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Vel on Thu 02/10/2003 10:52:23

Title: Playing the previous music
Post by: Vel on Thu 02/10/2003 10:52:23
Does anyone have an idea how to play the previous music? I want to play a track whenever the menu GUI is on, and switch back to the previous one once the gui is closed.
Title: Re:Playing the previous music
Post by: Gilbert on Thu 02/10/2003 10:57:05
Do this:

When the GUI's brought up, first save the music # it's currently playing and then set to new one. Example:

curmusic=GetCurrentMusic();
PlayMusic(10);


When the GUI is about to close, restore it:
PlayMusic(curmusic);

Of course, you may add usual stuffs yourself, like the declaration of the variable curmusic in some appropiate place, etc.
Title: Re:Playing the previous music
Post by: Vel on Thu 02/10/2003 11:27:54
Thanks a lot! It works.