Hover and click sounds for the title 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
BlindBlues
Newbie
Posts: 3
Joined: Fri Jul 26, 2019 8:30 pm
Contact:

Hover and click sounds for the title menu?

#1 Post by BlindBlues »

All the information I am finding is from years ago, and obviously doesn't work. Does anyone know how to go about doing this? I am new to using the program and haven't been able to figure it out.

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Hover and click sounds for the title menu?

#2 Post by Kia »

try:

Code: Select all

hover_sound "hover.mp3"
activate_sound "clicked.mp3"
you can also put them in the styles

BlindBlues
Newbie
Posts: 3
Joined: Fri Jul 26, 2019 8:30 pm
Contact:

Re: Hover and click sounds for the title menu?

#3 Post by BlindBlues »

Kia wrote: Sat Jul 27, 2019 1:09 am try:

Code: Select all

hover_sound "hover.mp3"
activate_sound "clicked.mp3"
you can also put them in the styles
Where would this go? In options.rpy? Sorry still learning how to use the program.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Hover and click sounds for the title menu?

#4 Post by namastaii »

You can look up more on styles and things but this is probably the easiest/most direct solution

Code: Select all

screen navigation():

    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5

        spacing gui.navigation_spacing

        if main_menu:

            textbutton _("Start") action Start() activate_sound "sound.ogg"

        else:

            textbutton _("History") action ShowMenu("history") activate_sound "sound.ogg"

            textbutton _("Save") action ShowMenu("save") activate_sound "sound.ogg"

        textbutton _("Load") action ShowMenu("load") activate_sound "sound.ogg"

        textbutton _("Preferences") action ShowMenu("preferences") activate_sound "sound.ogg"
just put hover_sound "yoursound.ogg" or activate_sound or whatever on the same line as the textbutton. This is a snippet of the main menu screen

BlindBlues
Newbie
Posts: 3
Joined: Fri Jul 26, 2019 8:30 pm
Contact:

Re: Hover and click sounds for the title menu?

#5 Post by BlindBlues »

Worked perfectly, thanks for the help!

Post Reply

Who is online

Users browsing this forum: No registered users