Music in specific screen only
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Newbie
- Posts: 9
- Joined: Tue Jul 02, 2019 12:51 pm
- Contact:
Music in specific screen only
Hello, how do I do such thing? When user calls a screen (e.g. a map), then a music starts to play in a loop and when he goes to another screen or closes the map one, the music stops. Thank you very much!
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Music in specific screen only
Code: Select all
screen demo_imagemap():
# <elements of the screen>
on 'show' action Play('music', 'music_file.mp3', fadein=0.4, fadeout=1.0)
on 'hide' action Stop('music', fadeout=2.7)
https://renpy.org/doc/html/screen_actions.html#Stop
https://renpy.org/doc/html/screens.html#on
Who is online
Users browsing this forum: No registered users