class BaseSlider
package feathers.controls.supportClasses
extends FeathersControl › MeasureSprite › ValidatingSprite
implements IFocusObject, IRange
extended by HSlider, VSlider
Base class for slider components.
Events:
openfl.events.Event.CHANGE | Dispatched when |
---|
1.0.0
.See also:
Variables
liveDragging:Bool = true
Determines if the slider dispatches the Event.CHANGE
event every time
that the thumb moves while dragging, or only after the user stops
dragging.
In the following example, live dragging is disabled:
slider.liveDragging = false;
1.0.0
.maximum:Float
The slider's value cannot be larger than the maximum.
In the following example, the maximum is set to 100.0
:
slider.minimum = 0.0;
slider.maximum = 100.0;
slider.step = 1.0;
slider.value = 12.0;
1.0.0
.See also:
maximumPadding:Float
The space, measured in pixels, between the maximum position of the thumb and the the maximum edge of the track. May be negative to optionally extend the draggable range of the thumb beyond the track's bounds.
In the following example, maximum padding is set to 20 pixels:
slider.maximumPadding = 20.0;
1.0.0
.See also:
minimum:Float
The slider's value cannot be smaller than the minimum.
In the following example, the minimum is set to -100.0
:
slider.minimum = -100.0;
slider.maximum = 100.0;
slider.step = 1.0;
slider.value = 50.0;
1.0.0
.See also:
minimumPadding:Float
The space, measured in pixels, between the minimum position of the thumb and the the minimum edge of the track. May be negative to optionally extend the draggable range of the thumb beyond the track's bounds.
In the following example, minimum padding is set to 20 pixels:
slider.minimumPadding = 20.0;
1.0.0
.See also:
secondaryTrackSkin:InteractiveObject
The skin to use for the slider's optional secondary track. If a slider has one track, it will fill the entire length of the slider. If a slider has a track and a secondary track, the primary track will stretch between the minimum edge of the slider and the location of the slider's thumb, while the secondary track will stretch from the location of the slider's thumb to the maximum edge of the slider.
In the following example, a track skin and a secondary track skin are passed to the slider:
var skin = new RectangleSkin();
skin.fill = SolidColor(0xaaaaaa);
slider.trackSkin = skin;
var skin = new RectangleSkin();
skin.fill = SolidColor(0xcccccc);
slider.secondaryTrackSkin = skin;
1.0.0
.See also:
snapInterval:Float
When the slider's value
changes, it may be "snapped" to the nearest
multiple of snapInterval
. If snapInterval
is 0.0
, the value
is
not snapped.
In the following example, the snap inverval is changed to 1.0
:
slider.minimum = 0.0;
slider.maximum = 100.0;
slider.step = 1.0;
slider.snapInterval = 1.0;
slider.value = 10.0;
1.0.0
.See also:
step:Float
Indicates the amount that value
is changed when the slider has focus
and one of the arrow keys is pressed.
In the following example, the step is changed to 1.0
:
slider.minimum = 0.0;
slider.maximum = 100.0;
slider.step = 1.0;
slider.value = 10.0;
1.0.0
.See also:
thumbSkin:InteractiveObject
The skin to use for the slider's thumb.
In the following example, a thumb skin is passed to the slider:
var skin = new RectangleSkin();
skin.fill = SolidColor(0xcccccc);
slider.thumbSkin = skin;
1.0.0
.See also:
trackSkin:InteractiveObject
The skin to use for the slider's track.
In the following example, a track skin is passed to the slider:
var skin = new RectangleSkin();
skin.fill = SolidColor(0xcccccc);
slider.trackSkin = skin;
1.0.0
.See also:
value:Float
The value of the slider, which must be between the minimum
and the
maximum
.
When the value
property changes, the slider will dispatch an event of
type Event.CHANGE
.
In the following example, the value is changed to 12.0
:
slider.minimum = 0.0;
slider.maximum = 100.0;
slider.step = 1.0;
slider.value = 12.0;
1.0.0
.See also:
openfl.events.Event.CHANGE
Methods
applyValueRestrictions():Void
Applies the minimum
, maximum
, and snapInterval
restrictions to the
current value
.
Because it's possible to set value
to a numeric value that is outside
the allowed range, or to a value that has not been snapped to the
interval, this method may be called to apply the restrictions manually.
1.0.0
.