Game Development Community

GUI Slider control question

by Mark Newnam · in Torque Game Builder · 06/22/2007 (12:20 pm) · 2 replies

I have an options gui with volume sliders for music and sound effects. Right now I have to accept my changes and exit the gui before the changes take effect. I would like to have the volume change as the slider is moved but I'm not sure how to do that.

Are there any threads out there about this topic? Or could someone give me a hint on getting this to work? I haven't been able to find anything.

Thanks!
Mark

#1
06/22/2007 (12:27 pm)
I think the OpenAL controls will work for this. Specifically check out alxSetChannelVolume( channelD , volume ).

See more audio controls here:
tdn.garagegames.com/wiki/TorqueScript_Console_Functions

Hope this helps!
#2
06/22/2007 (1:03 pm)
I figured it out right after I posted. I used the "command" variable of the control to call a function that sets the volume. This way as soon as the slider is clicked on, the volume is changed.

I knew about the alxSetChannelVolume, that's how I the volume was being changed after the options menu was closed, I just wasn't sure how to do it as the slider was being changed.

Thanks for the reply though.