Game Development Community

GuiSliderCtrl update as you drag

by Chris Labombard · 04/02/2006 (5:29 pm) · 0 comments

The current guiSliderCtrl object will only execute the command when you release the mouse button after dragging the slider.

To make it update AS your dragging the slider:

Backup your projectw
open guiSliderCtrl.cc
Find "GuiSliderCtrl::onMouseDragged"
Tack this onto the end of the function after updateThumb(value);

if (mConsoleCommand[0])
   {
   	char buf[16];
      dSprintf(buf, sizeof(buf), "%d", getId());
      Con::setVariable("$ThisControl", buf);
      Con::evaluate(mConsoleCommand, false);
   }

Compile
Enjoy