The idea is that Ren'Py will supply a series of actions that manipulate a playlist. It's then up to the creator to make a screen that takes advantage of those actions to become an actual music room. Here's the example code from the documentation.
Code: Select all
init python:
# Step 1. Create a MusicRoom instance.
mr = MusicRoom(fadeout=1.0)
# Step 2. Add music files.
mr.add("track1.ogg", always_unlocked=True)
mr.add("track2.ogg")
mr.add("track3.ogg")
# Step 3. Create the music room screen.
screen music_room:
tag menu
frame:
has vbox
# The buttons that play each track.
textbutton "Track 1" action mr.Play("track1.ogg")
textbutton "Track 2" action mr.Play("track2.ogg")
textbutton "Track 3" action mr.Play("track3.ogg")
null height 20
# Buttons that let us advance tracks.
textbutton "Next" action mr.Next()
textbutton "Previous" action mr.Previous()
null height 20
# The button that lets the user exit the music room.
textbutton "Main Menu" action ShowMenu("main_menu")
# Start the music playing on entry to the music room.
on "replace" action mr.Play()
# Restore the main menu music upon leaving.
on "replaced" action Play("music", "track1.ogg")
Rather than try to write thus up further, I've posted the documentation online:
http://www.renpy.org/dev-doc/html/rooms.html#music-room
If someone could proofread that, I'd appreciate it - it's hard to focus on proofreading.
You can take advantage of this today by grabbing the code from:
http://bazaar.launchpad.net/~renpytom/r ... icroom.rpy
and dropping it into your game. (You should also change the init -1135 in that file to something smaller, like init -100.)