The slider is a handle than can be moved within some limits.
- new (class, int x,y,w,h, [boolean vertical, [Skin2D, [Icon] ] ])
- returns: (Slider)
Creates Slider with given bounds. If vertical is true the slider
is vertical aligned.
- getSliderPos (Slider)
- returns: (float pos)
get the position of the slider 0-1.
- mouseWheeled (Slider,MouseEvent)
- returns: ()
This function sets the sliderposition if the
mousewheel was turned.
- onKeyTyped (Slider,KeyEvent)
- returns: ()
Attached to Slider with a keylistener.
Will react on arrow up/down/left/right keypresses and moves the slider.
- onValueChanged (Slider, float newvalue,prevvalue)
- returns: ()
called if the slider position was changed.
The values are always between 0 and 1. You can overload this function without
calling the original overloaded function. This function is only called if
the previous value is distinct from the new value.
- setIncrement
(),(Slider, float inc) - Sets sliderincrement of slider. You could
set the value directly by assigning a new value to the sliderincrement
value, but you shouldn't chose values <=0 or >1 and you should update
the sliderposition to its new value in case that the integermode is on
and the value is hereby changed.
- setIntegerMode
- (),(Slider, boolean on) - switches IntegerMode on and of. In integermode,
the values that are set are being rounded to even multiplies of the
sliderincrement value.
- setSliderPos (Slider, pos, noevent,force)
- returns: ()
set the position of the slider, calls automaticly the
onValueChanged method. The value is automaticly clamped to a value
between 0 and 1. If noevent is true, no valuechanged event is sent
- setSliderTo (Slider,x,y)
- returns: ()
sets the slider position nearest to a pixelposition
given by x and y that are in local coordinates of the component.
- sliderincrement
- {[float]}=0.1 - increment of sliderposition. Can be set per
slider. The increment value is used if the mousewheel or the arrow keys have been used.