Code: Select all
def callback(event, **kwargs):
if event == "show":
renpy.music.play(sound_blip, channel="sound", loop=True)
elif event == "slow_done" or event =="end":
renpy.music.stop(channel="sound", fadeout = 0.2)
However, just yesterday, I realized one bug: the sound won't stop if I call another screen in the middle of a dialogue, as in this video demonstrates: https://www.youtube.com/watch?v=eLqcu_2 ... e=youtu.be (the sound keeps play when I call the game menu screen)
I have been trying to add in condition in the callback function, such as:
Code: Select all
def callback(event, **kwargs):
if event == "show":
renpy.music.play(sound_blip, channel="sound", loop=True)
elif not renpy.get_screen("say"):
renpy.music.stop(channel="sound", fadeout = 0.2)
elif event == "slow_done" or event =="end":
renpy.music.stop(channel="sound", fadeout = 0.2)
Code: Select all
def callback(event, **kwargs):
if event == "show":
renpy.music.play(sound_blip, channel="sound", loop=True)
elif renpy.get_screen("game_menu"):
renpy.music.stop(channel="sound", fadeout = 0.2)
elif event == "slow_done" or event =="end":
renpy.music.stop(channel="sound", fadeout = 0.2)