Sound Effects On Buttons
by Tyler Pfaff · in Game Design and Creative Issues · 10/09/2004 (9:23 am) · 2 replies
I'm trying to be able to play sound effects when the mouse moves over buttons and when the mouse clicks a button. I know that I'm supposed to put the new AudioProfiles in init.cs, but where do I initialize the GuiButtonProfile's members soundButtonOver and soundButtonDown? Thanks in advance!
About the author
Torque 3D Owner Billy L
add the below lines to client/ui/defaultgameprofiles.cs
If you use another profile then GuiButtonProfile to your buttons you must add the above lines to that profile.
And change GuiButtonProfile to yourOtherProfile :) !!
And in
client/audioprofiles.cs add
new AudioProfile(AudioButtonOver) { filename "path to soundfile"; description = "AudioGui"; preload = true; } new AudioProfile(AudioButtonDown) { filename "path to soundfile"; description = "AudioGui"; preload = true; }if you want a buttonup sound you must change the guiButtonBaseCtrl.cc and
add some new lines to onMouseup.