I wanted to make the music fade out but it just simply doesn't work.
Here's the code:
Code: Select all
scene old-park-entrance with fade
stop music fadeout 3.0
play music "forest.mp3" loop fadein 3.0
Thank you in advance
Code: Select all
scene old-park-entrance with fade
stop music fadeout 3.0
play music "forest.mp3" loop fadein 3.0
I think you can also dolykoia wrote: ↑Thu May 07, 2020 9:17 am Hello, newbie here.
I wanted to make the music fade out but it just simply doesn't work.
Here's the code:I'm not sure what I did wrong but only the fade in from forest.mp3 works but the fadeout for all music.Code: Select all
scene old-park-entrance with fade stop music fadeout 3.0 play music "forest.mp3" loop fadein 3.0
Thank you in advance
Code: Select all
play music "forest.mp3" loop fadein 3.0 fadeout 3.0
Code: Select all
default active_music_channel = 'music' # stores which channel is playing and which not
default inactive_music_channel = 'music2'
init python:
renpy.music.register_channel('music2') # register the new channel for renpy
def playmusic(name, fade=3.0): # standard fade is 3 seconds
global active_music_channel, inactive_music_channel # be able to change the two "stores"
active_music_channel, inactive_music_channel = inactive_music_channel, active_music_channel # swap the two "stores"
renpy.music.stop(channel=inactive_music_channel, fadeout=fade) # fade out the music in one channel ...
renpy.music.play(name, channel=active_music_channel, fadein=fade) # and fade in the music in the other channel
label start:
$ playmusic('forest.mp3')
"wait for a few seconds, then click"
$ playmusic('othermusic.mp3')
"see?"
Users browsing this forum: Bing [Bot], Google [Bot], Sugar_and_rice