Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
neometalero
Regular
Posts: 198 Joined: Sun Oct 23, 2016 3:51 am
Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Deviantart: neometalero
Contact:
#1
Post
by neometalero » Fri Jun 18, 2021 2:22 pm
I defined a new audio channel like this
Code: Select all
init python:
renpy.music.register_channel("efectos", "sfx", False)
works fine, but now I want to add a slider on the options menu so you can control the volume of this channel. How would I do this?
Alex
Lemma-Class Veteran
Posts: 3094 Joined: Fri Dec 11, 2009 5:25 pm
Contact:
#2
Post
by Alex » Sat Jun 19, 2021 6:03 am
neometalero wrote: ↑ Fri Jun 18, 2021 2:22 pm
I defined a new audio channel like this
Code: Select all
init python:
renpy.music.register_channel("efectos", "sfx", False)
works fine, but now I want to add a slider on the options menu so you can control the volume of this channel. How would I do this?
Try to create a variable to store this channel volume, like
Then add a bar to control the volume into the preferences screen
Code: Select all
bar value VariableValue(variable='volume', range=1.0, action=renpy.music.set_volume(volume, delay=0, channel=u'efectos') )
https://www.renpy.org/doc/html/screen_a ... iableValue
https://www.renpy.org/doc/html/audio.ht ... set_volume
neometalero
Regular
Posts: 198 Joined: Sun Oct 23, 2016 3:51 am
Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Deviantart: neometalero
Contact:
#3
Post
by neometalero » Sat Jun 19, 2021 10:21 am
Alex wrote: ↑ Sat Jun 19, 2021 6:03 am
neometalero wrote: ↑ Fri Jun 18, 2021 2:22 pm
I defined a new audio channel like this
Code: Select all
init python:
renpy.music.register_channel("efectos", "sfx", False)
works fine, but now I want to add a slider on the options menu so you can control the volume of this channel. How would I do this?
Try to create a variable to store this channel volume, like
Then add a bar to control the volume into the preferences screen
Code: Select all
bar value VariableValue(variable='volume', range=1.0, action=renpy.music.set_volume(volume, delay=0, channel=u'efectos') )
https://www.renpy.org/doc/html/screen_a ... iableValue
https://www.renpy.org/doc/html/audio.ht ... set_volume
tks a lot, this worked great!
the only inconvenient I have now is that the new bar's looks is different than the other ones. Any idea how I can fix this?
Alex
Lemma-Class Veteran
Posts: 3094 Joined: Fri Dec 11, 2009 5:25 pm
Contact:
#4
Post
by Alex » Sat Jun 19, 2021 11:34 am
Try to apply the proper style to button (or specify it inside a Variable Value - see the link about it).
neometalero
Regular
Posts: 198 Joined: Sun Oct 23, 2016 3:51 am
Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
Deviantart: neometalero
Contact:
#5
Post
by neometalero » Sat Jun 19, 2021 5:28 pm
Alex wrote: ↑ Sat Jun 19, 2021 11:34 am
Try to apply the proper style to button (or specify it inside a Variable Value - see the link about it).
Tks! I applied the slider style to it and worked just fine.
Users browsing this forum: No registered users