Page 1 of 1

slider value

Posted: Mon Dec 18, 2006 07:51
by yuriythebest
I'm adding a sound control window for my app, where the volume is controlled by a slider, I've done everything up to this point, however I'm confused as to how to link the slider value- the position of the sliding thingy- to a variable. I've already created and eventHandler that does 'something' when the user interacts with the slider.

in an old thread it says that there is a someSlider->getValue() command:
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1819&highlight=slider


however I found no such command. So how does one get the value?

Posted: Mon Dec 18, 2006 07:57
by scriptkid
Hi,

it is (in 0.5 at least):

Code: Select all

float valueSlider = slider->getCurrentValue(); // Retrieve the value


In case you used this method, make sure that 'slider' is casted towards a GUISlider.

Good luck.

Posted: Mon Dec 18, 2006 13:00
by yuriythebest
thanks mate it works! :D