Button sounds

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
User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Button sounds

#1 Post by isobellesophia » Sun Aug 25, 2019 9:06 am

Hello,

I would like to ask for a help, how would i make a code for adding some sounds when clicking/or hovering it?

I searched through google and i also forgot how to use it, but most of it arent working and outdated..\

Any help is a thanks.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Angelo Seraphim
Regular
Posts: 32
Joined: Tue May 21, 2019 8:00 am
Completed: Enamored Risks (NaNoReNo 2020)
Projects: 616 Charagma
Organization: GLSUoA
Deviantart: glsuoa
itch: glsuoa
Location: London, UK
Discord: Just A Concept#9599
Contact:

Re: Button sounds

#2 Post by Angelo Seraphim » Sun Aug 25, 2019 9:43 am

Have you tried "hover_sound" and "activate_sound" ?

Something like this:

Code: Select all

textbutton _("Button"):
    hover_sound "hover.ogg"
    activate_sound "click.ogg"
    action NullAction()
Image

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Button sounds

#3 Post by isobellesophia » Sun Aug 25, 2019 9:53 am

Angelo Seraphim wrote:
Sun Aug 25, 2019 9:43 am
Have you tried "hover_sound" and "activate_sound" ?

Something like this:

Code: Select all

textbutton _("Button"):
    hover_sound "hover.ogg"
    activate_sound "click.ogg"
    action NullAction()

Thanks, that'll work!
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

Users browsing this forum: Bing [Bot]