Class BaseSlider<TValueType, THandleValueType>
Base class for any Slider (TouchSliderFloat, TouchSliderInt, SliderFloat, SliderInt).
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public abstract class BaseSlider<TValueType, THandleValueType> : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IValidatableElement<TValueType>, INotifyValueChanging<TValueType>, INotifyValueChanged<TValueType> where TValueType : IEquatable<TValueType> where THandleValueType : struct, IComparable, IEquatable<THandleValueType>
Type Parameters
Name | Description |
---|---|
TValueType | A comparable value type. |
THandleValueType | A value type for a single handle of the slider. This can be the same as |
Constructors
Name | Description |
---|---|
BaseSlider() | Default constructor. |
Fields
Name | Description |
---|---|
m_DraggerManipulator | The dragger manipulator used to move the slider. |
m_HighValue | Slider max value. |
m_LowValue | Slider min value. |
m_PreviousValue | The previous value of the slider before the user started interacting with it. |
m_Value | The current value of the slider. |
Properties
Name | Description |
---|---|
formatString | The format string used to display the value of the slider. |
highValue | Specify the maximum value in the range of this slider. |
invalid | The invalid state of the slider. |
lowValue | Specify the minimum value in the range of this slider. |
validateValue | The validation function used to validate the value of the slider. |
value | The current value of the slider. |
Methods
Name | Description |
---|---|
Clamp(TValueType, THandleValueType, THandleValueType) | Utility method to clamp a |
ClampValue() | Called when the low or high value has changed and needs to check if the current value fits in this new range. |
ComputeValueFromHandlePosition(float, float) | Returns the value to set as slider value based on a given dragger position. |
Decrement(THandleValueType) | Method to implement which returns the decrement of a given value. |
GetClampedValue(TValueType) | Return the clamped value using current lowValue and highValue values.
|
GetSliderRect() | Returns the rect of the interactive part of the slider. |
Increment(THandleValueType) | Method to implement which returns the increment of a given value. |
OnGeometryChanged(GeometryChangedEvent) | Event callback called when the geometry of the slider has changed in the layout. |
OnSliderRangeChanged() | Called when the low or high value of Slider has changed. |
OnTrackClicked() | Called when the track has received a click event.
|
OnTrackDown(Draggable) | Event callback called when a pointer down event is received. |
OnTrackDragged(Draggable) | Event callback called when the dragger is dragged. |
OnTrackUp(Draggable) | Event callback called when a pointer up event is received. |
ParseHandleValueToString(THandleValueType) | Method to implement to resolve a You can use ToString() for floating point value types for example. You can also round the value if you want a specific number of decimals. |
ParseStringToValue(string, out TValueType) | Method to implement to resolve a string value into a You can use TryParse(string, out float) for floating point value types for example. |
ParseValueToString(TValueType) | Method to implement to resolve a You can use ToString() for floating point value types for example. You can also round the value if you want a specific number of decimals. |
SetValueFromDrag(float) | Custom implementation of the slider value from the drag position. |
SetValueWithoutNotify(TValueType) | Set the value of the slider without sending any event. |
SliderLerpUnclamped(THandleValueType, THandleValueType, float) | Method to implement which returns a value based on the linear interpolation of a given interpolant between a specific range. Usually you can use directly LerpUnclamped(float, float, float) for floating point value types. |
SliderNormalizeValue(THandleValueType, THandleValueType, THandleValueType) | Method to implement which returns the normalized value of a given value in a specific range. Usually you can use directly an InverseLerp(float, float, float) for floating point value types. |