Imagebutton hover sound

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
Husky
Newbie
Posts: 22
Joined: Fri May 01, 2015 12:32 pm
Contact:

Imagebutton hover sound

#1 Post by Husky »

http://i.imgur.com/PfoTK4G.png

I have these imagebuttons in my main menu. And I have a "click.wav" file in "sound" folder. So I want my click to be heard, when I hover over the imagebuttons.

I typed in in options:
style.imagebutton.hover_sound = "sound/click.wav" but apparently it doesn't work.
Is there a different way to stylize these imagebuttons?

User avatar
78909087
Veteran
Posts: 277
Joined: Sat Aug 16, 2014 2:33 pm
Completed: Dungeons and Don't Do It, Wake Up
Projects: Lethe
IRC Nick: Pacermist
Contact:

Re: Imagebutton hover sound

#2 Post by 78909087 »

While looking for a fix, I found this page. It lead me to this page, where it states the style properties for buttons.

Imagebuttons, under screen language are set up like this;

Code: Select all

screen gui_game_menu():
     vbox xalign 1.0 yalign 1.0:
          imagebutton auto "save_%s.png" action ShowMenu('save')
          imagebutton auto "prefs_%s.png" action ShowMenu('preferences')
          imagebutton auto "skip_%s.png" action Skip()
          imagebutton auto "afm_%s.png" action Preference("auto-forward mode", "toggle")
Perhaps try adding another function to it, like this. (I cannot test this at the moment)

Code: Select all

screen gui_game_menu():
     vbox xalign 1.0 yalign 1.0:
          imagebutton auto "save_%s.png" action ShowMenu('save') hovered Play("sound/click.wav")
          imagebutton auto "prefs_%s.png" action ShowMenu('preferences') hovered Play("sound/click.wav")
          imagebutton auto "skip_%s.png" action Skip() hovered Play("sound/click.wav")
          imagebutton auto "afm_%s.png" action Preference("auto-forward mode", "toggle") hovered Play("sound/click.wav")
This is just a quick help. If you're still confused after trying that information, feel free to reply.
I am not friends with the sun.
Image

Valiowk
Newbie
Posts: 22
Joined: Sat Jan 02, 2016 8:32 pm
Contact:

Re: Imagebutton hover sound

#3 Post by Valiowk »

style.image_button.hover_sound = "sound/click.wav" (with an underscore between "image" and "button") will work.

Post Reply

Who is online

Users browsing this forum: Doeny, Google [Bot]