Help needed for Volume slider control...
by Shunmugam · in Torque Game Builder · 12/10/2008 (12:17 am) · 3 replies
Hi, everyone. i'm strange to volume slider control options, i.e., increase and decrease volume level in a game. I saw in many games there is a option to reduce music and sound effects by slider control.
I know about there's a control in GUI, GuiSliderCtrl, but i don't know how to use this into the game.
anyone help...
I know about there's a control in GUI, GuiSliderCtrl, but i don't know how to use this into the game.
anyone help...
About the author
#2
Specify an altCommand on the GuiSliderCtrl that triggers when the thumb on the control is updated (e.g. when being dragged). For setting the volume, use alxSetChannelVolume( channel, volume ) to set the volume on the channel you are using to play back your sounds (in stock TGB it's $musicAudioType for music and $effectsAudioType for sound effects).
To see an example for this, simply take a look at common/gui/options.gui and common/gameScripts/options.cs. Like you said, the sliders in the options dialog do this kind of thing.
06/02/2009 (5:17 am)
Specify an altCommand on the GuiSliderCtrl that triggers when the thumb on the control is updated (e.g. when being dragged). For setting the volume, use alxSetChannelVolume( channel, volume ) to set the volume on the channel you are using to play back your sounds (in stock TGB it's $musicAudioType for music and $effectsAudioType for sound effects).
To see an example for this, simply take a look at common/gui/options.gui and common/gameScripts/options.cs. Like you said, the sliders in the options dialog do this kind of thing.
#3
06/11/2009 (7:50 pm)
Thanks i'll try it
Suharian Ramadi