scroll 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

nickak2003
Just popping in
Just popping in
Posts: 4
Joined: Sun Apr 09, 2006 08:17

scroll value

Postby nickak2003 » Fri Apr 14, 2006 09:56

Hi, I am trying to get the scrollvalue, but it always seems to return one, even though its being moved around. I set the value of some static text equal to its value, and it is always 1

Code: Select all

      CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
      std::stringstream sstr;
      sstr<<((CEGUI::Slider*)wmgr.getWindow("slider1"))->getCurrentValue() << " ";
      OutputDebugString( sstr.str().c_str() );
      ((CEGUI::StaticText*)wmgr.getWindow("static1"))->setText( sstr.str() );

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Postby Van » Fri Apr 14, 2006 13:13

I think the values are between 0.0 and 1.0. Anything above 1.0 is set to 1.0. That is your range. 0-10 won't work. it has to be 0.0 - 1.0 with 0.1 increments ( or finer ).

nickak2003
Just popping in
Just popping in
Posts: 4
Joined: Sun Apr 09, 2006 08:17

Postby nickak2003 » Fri Apr 14, 2006 21:13

I havent set any properties effecting the max or minimum of the scroll.
After loading the control, I set it up like this:

Code: Select all

   //static_cast<CEGUI::Slider*>(wmgr.getWindow("slider1"))->subscribeEvent(CEGUI::Slider::EventValueChanged, CEGUI::Event::Subscriber(&GameMode_test::slider_slide, this));
   CEGUI::Slider* slider= static_cast<CEGUI::Slider*>(wmgr.getWindow("slider1"));
   //slider->setMaxValue(1);
   slider->setClickStep(0.1f);
   //slider->setCurrentValue(1);

The several lines commented out generate runtime errors.

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Postby jacmoe » Sat Apr 15, 2006 01:23

I don't think the values are clamped between 0.0 and 1.0.
But I think it is a problem if you pass it ints instead of floats.
Try this:

Code: Select all

   slider->setMaxValue(1.0f);
   slider->setClickStep(0.1f);
   slider->setCurrentValue(1.0f);


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests