Instead of a slider for volume, is it possible to make a set of buttons? An up arrow button and a down arrow button? With corresponding text that goes "1%", "2%", etc.?
Right now, I'm dealing with a slider that seems to extend way past its image, all the way to the end of my computer screen.
Creating a volume button instead of a slider?
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.
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Creating a volume button instead of a slider?
something like...
https://renpy.org/doc/html/audio.html#r ... set_volume
https://renpy.org/doc/html/screen_actio ... etVariable
Code: Select all
default mvol = .3
screen euqvi():
$ renpy.music.set_volume(mvol, channel='music')
$ mvolreal = int(mvol*100)
vbox at topleft:
text 'volume [mvolreal] %'
textbutton '^' action SetVariable('mvol', mvol + .01 if mvol < .99 else 1.0)
textbutton 'v' action SetVariable('mvol', mvol - .01 if mvol > .01 else 0.0)
label start:
play music 'testmusic.mp3'
show screen euqvi
pause
https://renpy.org/doc/html/screen_actio ... etVariable
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Creating a volume button instead of a slider?
If you want the slider to not use the whole screen, place it inside something, like a vbox that has an xmaximum set.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- Bryy
- Veteran
- Posts: 407
- Joined: Thu Dec 20, 2012 10:12 pm
- Completed: 30+ games so far
- Projects: Furry Shakespeare
- Organization: Stegalosaurus Game Development
- Location: Portage, MI
- Contact:
Re: Creating a volume button instead of a slider?
Thank you both.
Who is online
Users browsing this forum: Ocelot