Game Development Community

GuiSliderCtrl update as you drag

by Chris Labombard · 04/02/2006 (10:29 am) · 1 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

About the author

I have been a professional game programmer for over 5 years now. I've worked on virtually every platform, dozens of games and released a few of my own games, including 2 iPhone titles and a title waiting release on Big Fish Games.


#1
11/16/2010 (1:05 am)
Copy/paste/compile, worked in TGEA 1.8.2 perfectly! THANKS!