ages ago I finalllyyy got the music player working in my game, and now im finally working on some updates now that the demo is out.
TLDR I added a button to hide it (bc why have it on the screen the whole time) and a button to show it back up in another place
but I think the sudden disappearance is slightly jarring. I'd love to be able to add a transition to it when it hides so that I can pretend its like a window minimizing
that said I think I just want to use the renpy dissolve transition for it
Im horrible at organizing these posts but i essentially just want the screen to dissolve off when it hides
here's some spaghetti
Code: Select all
imagebutton auto "gui/mp_hide_%s.png":
xpos 455
ypos 3
focus_mask True
action Function(renpy.hide_screen, "textmiddle")
And here's the whole screen itself if it helps
Code: Select all
screen textmiddle:
default music_is_playing = False #i know this seems contradictory but this is just the default states, plus i triggered music to start once we enter into game immediately
default music_is_paused = False
drag:
draggable True
droppable False
drag_raise True
pos(1375,50)
drag_offscreen (200, 200)
frame:
background None
image "gui/musicplayer.png"
$ playing = renpy.music.get_playing("music")
if playing is not None:
transclude
$ track_name = track[1]
$ track_creator = track[2]
text "{size=25}Now Playing...{/size}" yalign 0.01 xalign 0.01
text "[song_name] - [song_description]" yalign 0.05 xalign 0.01
else:
text "No Music Playing" xalign 0.5 yalign 0.5
##below are the buttons and how we set them up to work with the music rooM! not sure if its correct or not, but it works and thats all i care about at this point
imagebutton auto "gui/mp_hide_%s.png":
xpos 455
ypos 3
focus_mask True
action Function(renpy.hide_screen, "textmiddle")
imagebutton auto "gui/mm_pause_%s.png":
xpos 128
ypos 85
focus_mask True #focus mask makes it hoverable, its just image buttons like ud see on the main menu of games!
action [SetVariable('current_track', renpy.music.get_playing()),
mr.TogglePause()]
hovered [ Play("sound", "audio/click.wav") ] #plays this sound when clicked
imagebutton auto "gui/mp_play_%s.png":
xpos 216
ypos 85
focus_mask True
action [SetVariable('current_track', renpy.music.get_playing()),
mr.TogglePause()]
hovered [ Play("sound", "audio/click.wav") ]
imagebutton auto "gui/mp_skip_%s.png" xpos 309 ypos 85 focus_mask True action mr.Next() hovered [ Play("sound", "audio/click.wav") ]