slider value

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

yuriythebest
Just popping in
Just popping in
Posts: 6
Joined: Mon Dec 04, 2006 15:15

slider value

Postby yuriythebest » Mon Dec 18, 2006 07:51

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?

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Mon Dec 18, 2006 07:57

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.

yuriythebest
Just popping in
Just popping in
Posts: 6
Joined: Mon Dec 04, 2006 15:15

Postby yuriythebest » Mon Dec 18, 2006 13:00

thanks mate it works! :D


Return to “Help”

Who is online

Users browsing this forum: No registered users and 21 guests