Package tripleplay.ui
Class Slider
Displays a bar and a thumb that can be slid along the bar, representing a floating point value
between some minimum and maximum.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Holds the minimum and maximum values for the slider.Nested classes/interfaces inherited from class tripleplay.ui.Element
Element.Take
-
Field Summary
Modifier and TypeFieldDescriptionstatic Style<Background>
The background that renders the bar (defaults to a black rectangle).The height of the bar.static Style<Background>
The background that renders the "on" part of the bar, if it should be different from the default bar background.The width of the bar of an unstretched slider.final react.Value<Slider.Range>
The range of the slider.The image to use for the slider thumb.static Style<pythagoras.f.IPoint>
The origin of the thumb image (used to center the thumb image over the tray).final react.Value<Float>
The value of the slider. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreact.SignalView<Slider>
clicked()
A signal that is emitted when the user has released their finger/pointer after having started adjusting the slider.Getter for the slider increment value.float
max()
Returns our maximum allowed value.float
min()
Returns our minimum allowed value.setIncrement
(float increment) Constrains the possible slider values to the given increment.Methods inherited from class tripleplay.ui.Element
addStyles, addStyles, bindEnabled, bindVisible, bounds, constraint, enabledSlot, hierarchyChanged, isAdded, isEnabled, isShowing, isVisible, location, parent, setConstraint, setEnabled, setStyles, setStyles, setVisible, size, styles, visibleSlot, x, y
-
Field Details
-
BAR_WIDTH
The width of the bar of an unstretched slider. The slider's preferred width will be this width plus the width of the thumb image (which can extend past the left edge of the bar by half its width and the right edge of the bar by half its width). Inherited. -
BAR_HEIGHT
The height of the bar. The slider's preferred height will be the larger of this height and the height of the thumb image. Inherited. -
BAR_BACKGROUND
The background that renders the bar (defaults to a black rectangle). Inherited. -
BAR_ON_BACKGROUND
The background that renders the "on" part of the bar, if it should be different from the default bar background. If this is defined, the background will be instantiated at the full bar size, and clipped to the visible "on" region. Inherited. -
THUMB_IMAGE
The image to use for the slider thumb. Inherited. -
THUMB_ORIGIN
The origin of the thumb image (used to center the thumb image over the tray). If left as the default (null), the center of the thumb image will be used as its origin. Inherited. -
value
The value of the slider. -
range
The range of the slider.
-
-
Constructor Details
-
Slider
public Slider()Constructs a new slider with empty range and zero value. -
Slider
public Slider(float value, float min, float max)
-
-
Method Details
-
setIncrement
-
increment
Getter for the slider increment value. Note that it is a Float object and may be null. -
clicked
A signal that is emitted when the user has released their finger/pointer after having started adjusting the slider.value
will contain the correct current value at the time this signal is emitted. -
max
public float max()Returns our maximum allowed value. -
min
public float min()Returns our minimum allowed value.
-