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.
Sorry if this has been answered before, but I've been searching for days and couldn't find a relevant result using styles.
I've got several variations of a button sound I would like to use to prevent navigation from sound annoying, but I can't seem to find a way to make the sound change with each hover.
My code looks like this, and it only seems to generate a first random choice upon start and never making another choice again. Is there any way I could have it cycling through sounds, or at least randomize them?
SandraMJ wrote: ↑Mon Apr 13, 2020 6:40 pm
Sorry if this has been answered before, but I've been searching for days and couldn't find a relevant result using styles.
I've got several variations of a button sound I would like to use to prevent navigation from sound annoying, but I can't seem to find a way to make the sound change with each hover.
My code looks like this, and it only seems to generate a first random choice upon start and never making another choice again. Is there any way I could have it cycling through sounds, or at least randomize them?
style your_button_style:
align (0.5, 0.5)
## Do not put the hover_sound property inside a defined style. Do it directly in the screen, perhaps.
screen sample:
button:
style "your_button_style"
hover_sound (lambda: renpy.random.choice(your_list_of_sounds))()