I've made a music room using this tutorial : http://www.renpy.org/doc/html/rooms.html#music-room
I want to change the color of the text when it's the selected music.
(tr[fr] contains music titles, music the filenames, music_room_musics the musics displayed in music-room)
Edit: WORKING SOLUTION:
Code: Select all
init python:
style.musicroom_musiclabel = Style(style.button_text)
style.musicroom_musiclabel.background = Frame("images/interface/music_library_button.png", 25, 25)
style.musicroom_musiclabel.hover_background = Frame("images/interface/music_library_button_hover.png", 25, 25)
style.musicroom_musiclabel.selected_background = Frame("images/interface/music_library_button_selected.png", 25, 25)
style.musicroom_musiclabel_button_text.color = "#FF0000"
style.musicroom_musiclabel_button_text.hover_color = "#0000FF"
style.musicroom_musiclabel_button_text.selected_color = "#00FF00"
screen music_room:
side "c r":
area (67, 110, 775, 457)
viewport id "vp":
draggable True
mousewheel True
vbox:
for k in music_room_musics:
textbutton tr["fr"].music[k] action [mr.Play(music[k]), SelectedIf(renpy.music.get_playing() == music[k])] style "musicroom_musiclabel" text_style "musicroom_musiclabel_button_text"
Code: Select all
init python:
style.musicroom_musiclabel = Style(style.button_text)
style.musicroom_musiclabel.background = Frame("images/interface/music_library_button.png", 25, 25)
style.musicroom_musiclabel.hover_background = Frame("images/interface/music_library_button_hover.png", 25, 25)
style.musicroom_musiclabel.selected_background = Frame("images/interface/music_library_button_selected.png", 25, 25)
style.musicroom_musiclabel.color = "#FF0000"
style.musicroom_musiclabel.hover_color = "#0000FF"
style.musicroom_musiclabel.selected_color = "#00FF00"
screen music_room:
side "c r":
area (67, 110, 775, 457)
viewport id "vp":
draggable True
mousewheel True
vbox:
for k in music_room_musics:
textbutton tr["fr"].music[k] action [mr.Play(music[k]), SelectedIf(renpy.music.get_playing() == music[k])] style "musicroom_musiclabel"
I've tried to apply the style to the text directly the following thing :
Code: Select all
textbutton Text(tr["fr"].music[k],style="musicroom_musiclabel") action [mr.Play(music[k]), SelectedIf(renpy.music.get_playing() == music[k])] style "musicroom_musiclabel"
Is it a bug or Am I doing something wrong?