Slider
A slider containing floating point values.
Read time 11 minutesLast updated 3 hours ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: BaseSlider<float>
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<float>, IValueField<float>
[Icon("UIToolkit/Icons/Slider.png")][UxmlElement(libraryPath = "Controls")]public class Slider : BaseSlider<float>, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<float>, IValueField<float>
Remarks
The Slider control is a horizontal or vertical bar with a handle that can be moved to select a value from a range. The range is defined by the and properties.
lowValuehighValueThe slider manages navigation events in a customized manner. When it detects NavigationMoveEvent. that align with the slider's direction, it adjusts the slider's value. If it detects a NavigationSubmitEvent, it removes the BaseSlider<TValueType>.movableUssClassName class from the dragger, causing all Navigation events to revert to their default behavior. A second navigation submit event re-enables the movableUssClassName class on the dragger and restores the previous customized behavior.
For more information and code examples, refer to the UXML element Slider manual page.
Additional Resources: MinMaxSlider
Static Fields
Value | Description |
|---|---|
| inputUssClassName | USS class name of input elements in elements of this type. |
| labelUssClassName | USS class name of labels in elements of this type. |
| ussClassName | USS class name of elements of this type. |
Constructors
Constructor | Description |
|---|---|
| Slider() | Creates a new instance of a Slider. |
| Slider(System.Single,System.Single,UnityEngine.UIElements.SliderDirection,System.Single) | Creates a new instance of a Slider. |
| Slider(System.String,System.Single,System.Single,UnityEngine.UIElements.SliderDirection,System.Single) | Creates a new instance of a Slider. |