Page 1 of 1

I want to turn off the sound when I return to the main menu using the quick menu.

Posted: Sat Oct 08, 2022 3:18 am
by yoyuchi
Good day.
While the long SE sound is playing in the game, if return to the main menu using the quick menu, sound remains and is playing on the main menu.
How do I turn off the SE sound when I return to the main menu through the quick menu?

Code: Select all

imagebutton:
                idle "grp/parts/Mquit_idle.png"
                hover "grp/parts/Mquit_hover.png"
                activate_sound "sound/se/se_02.ogg" hover_sound "sound/se/se_01.ogg" 
                action [$ renpy.sound.stop(channel=0), Preference("auto-forward", "disable"), MainMenu()]
I tried to put the command like this, but an error occurred.
What command should I put in the "action"?
I need your help.
Thank you in advance.

Re: I want to turn off the sound when I return to the main menu using the quick menu.

Posted: Thu Oct 20, 2022 10:22 am
by plastiekk
yoyuchi wrote:
Sat Oct 08, 2022 3:18 am

Code: Select all

imagebutton:
                idle "grp/parts/Mquit_idle.png"
                hover "grp/parts/Mquit_hover.png"
                activate_sound "sound/se/se_02.ogg" hover_sound "sound/se/se_01.ogg" 
                action [$ renpy.sound.stop(channel=0), Preference("auto-forward", "disable"), MainMenu()]
Your action should look like this:

Code: Select all

action [Function(renpy.sound.stop), Preference("auto-forward", "disable"), MainMenu()]
Notice there is a difference between
renpy.sound.stop and
renpy.music.stop