Sounds in GUI
by Stephen Hagyard · in Torque Game Engine · 07/08/2003 (6:52 pm) · 1 replies
What do I add to the datablock to make a sound (wav file) play when the button is pressed?
Thanks in advance - Stephen Hagyard.
Thanks in advance - Stephen Hagyard.
About the author
Torque Owner Sabrecyd
GuiButtonProfile.soundButtonDown = "AudioButtonOver2";
Then in client/scripts/audioProfiles.cs add:
new AudioProfile(AudioButtonOver2)
{
filename = "~/data/sound/buttonDown.wav";
description = "AudioGui";
preload = true;
};
This will add the buttonDown sound when any of the buttons are pressed. You can of course use different profiles to make different sounds for specific buttons.
-Sabrecyd