The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: shaz on June 19, 2009, 11:13:12 PM

Title: Stop music playing when game window loses focus
Post by: shaz on June 19, 2009, 11:13:12 PM
Posting this here 'cause I think it'll be a change in a script somewhere that's needed...

When playing the game in a window, if you click on another window and the game loses the focus, activity stops, but BGM and BGS continue to play.

Does anyone know how to make the sounds stop when the window loses the focus, and start again when it gains the focus?
Title: Re: Stop music playing when game window loses focus
Post by: tSwitch on June 19, 2009, 11:50:21 PM
I'm not certain, but I don't think that's something any old script can handle, I think it'll require modification to RGSS libraries, or the player.
Title: Re: Stop music playing when game window loses focus
Post by: shaz on June 19, 2009, 11:53:19 PM
I was afraid of that.  I suspected window losing focus == scripts no longer playing.

Maybe the best I can achieve is to fade the music when the mouse leaves the window and bring the volume back to normal when it returns...