BaseSlider<TValueType>
This is a base class for the Slider fields.
Read time 10 minutesLast updated 8 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: BaseField<T>
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<T>, IValueField<T>
[UxmlElement]public abstract class BaseSlider<TValueType> : BaseField<TValueType>, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<TValueType>, IValueField<TValueType> where TValueType : IComparable<TValueType>
Static Fields
Value | Description |
|---|---|
| dragContainerUssClassName | USS class name of container elements in elements of this type. |
| draggerBorderUssClassName | USS class name of the dragger border element in elements of this type. |
| draggerUssClassName | USS class name of dragger elements in elements of this type. |
| fillUssClassName | USS class name of fill element in elements of this type. |
| horizontalVariantUssClassName | USS class name of elements of this type, when they are displayed horizontally. |
| inputUssClassName | USS class name of input elements in elements of this type. |
| labelUssClassName | USS class name of labels in elements of this type. |
| movableUssClassName | USS class name on the dragger that indicates it is currently controlled by NavigationMoveEvent. When the slider detects move events aligned with the slider's direction, it adjusts the slider's value. If it detects a navigation submit event, it removes the style, causing all navigation events to revert to their default behavior. A second navigation submit event re-applies the style to the dragger and restores the previous customized behavior. |
| textFieldClassName | USS class name of the text field element in elements of this type. |
| trackerUssClassName | USS class name of tracker elements in elements of this type. |
| ussClassName | USS class name of elements of this type. |
| verticalVariantUssClassName | USS class name of elements of this type, when they are displayed vertically. |
Properties
Property | Description |
|---|---|
| direction | This is the actual property to contain the direction of the slider. |
| fill | Enables fill to set the color and shape of a slider. |
| highValue | This is the maximum value that the slider encodes. |
| inverted | This indicates whether or not this slider is inverted. For an inverted horizontal slider, high value is located to the left, low value is located to the right For an inverted vertical slider, high value is located to the bottom, low value is located to the top. |
| lowValue | This is the minimum value that the slider encodes. |
| pageSize | Represents the value that should be applied to the calculated scroll offset while scrolling the slider, such as when clicking within the track or clicking the slider arrows. |
| range | This is the range from the minimum value to the maximum value of the slider. |
| showInputField | The visibility of the optional field inside the slider control. |
| value | The actual value of the slider. |
Methods
Method | Description |
|---|---|
| AdjustDragElement | Method used to adjust the dragelement. Mainly used in a scroller. |
| ApplyInputDeviceDelta | Called when the user is dragging the label to update the value contained in the field. |