Bar sound in the Settings menu

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.
Post Reply
Message
Author
yoyuchi
Regular
Posts: 61
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

Bar sound in the Settings menu

#1 Post by yoyuchi »

Good day.
Activate and hover sound were added to the image button in the preference menu. And how can I put activate and hover sound into "bar menu" such as volume control and transparency control?

activate_sound "sound/se/se_02.ogg" hover_sound "sound/se/se_01.ogg"

I tried to place it here and there, but it was impossible.
Here's my script. What should I do?

Code: Select all

vbox:
    style_group "prefs"
    vbox:
        bar value Preference("music volume") #at bar_transform  
        
        activate_sound "sound/se/se_02.ogg"        
        hover_sound "sound/se/se_01.ogg"
        
        pos(10, 119)
    vbox:
        bar value Preference("voice volume") 
        pos(10, 176)
Thank you in advance.

laure44
Regular
Posts: 84
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Bar sound in the Settings menu

#2 Post by laure44 »

You can't use activate_sound and hover_sound for bars (or for vbox like in your exemple), however you can do something like this:

Code: Select all

bar:
    value Preference("music volume") #at bar_transform
    released Play("sound", "sound/se/se_02.ogg")
    hovered Play("sound", "sound/se/se_01.ogg")

yoyuchi
Regular
Posts: 61
Joined: Sat Jul 09, 2022 1:39 pm
Contact:

Re: Bar sound in the Settings menu

#3 Post by yoyuchi »

laure44 wrote: Tue Oct 04, 2022 2:06 pm You can't use activate_sound and hover_sound for bars (or for vbox like in your exemple), however you can do something like this:

Code: Select all

bar:
    value Preference("music volume") #at bar_transform
    released Play("sound", "sound/se/se_02.ogg")
    hovered Play("sound", "sound/se/se_01.ogg")
Your script works fine!
The bar is making se sound.
You're amazing!!! :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]