Class RangeSliderFloat
Range Slider UI element for floating point values.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class RangeSliderFloat : Slider<Vector2, float, Vector2Field>, IEventHandler, IVisualElementScheduler, IExperimentalFeatures, ITransitionAnimations, ITransform, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<Vector2>, IValidatableElement<Vector2>, INotifyValueChanging<Vector2>, INotifyValueChanged<Vector2>, IFormattable<float>
Constructors
RangeSliderFloat()
Default constructor.
Declaration
public RangeSliderFloat()
Properties
maxValue
The high part of the range value.
Declaration
public float maxValue { get; set; }
Property Value
Type | Description |
---|---|
float |
minValue
The low part of the range value.
Declaration
public float minValue { get; set; }
Property Value
Type | Description |
---|---|
float |
thumbCount
Get the number of thumbs for this slider.
Declaration
protected override int thumbCount { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Methods
ClampThumb(float, float, float)
Clamp the thumb value.
Declaration
protected override float ClampThumb(float x, float min, float max)
Parameters
Type | Name | Description |
---|---|---|
float | x | The value to clamp. |
float | min | The minimum value. |
float | max | The maximum value. |
Returns
Type | Description |
---|---|
float | The clamped values. |
Overrides
GetScalarValuesFromValue(Vector2, Span<float>)
Get the list of thumb values from the TValue value. This must be sorted.
Declaration
protected override void GetScalarValuesFromValue(Vector2 v, Span<float> values)
Parameters
Overrides
GetStepCount(float)
Declaration
protected override int GetStepCount(float stepValue)
Parameters
Type | Name | Description |
---|---|---|
float | stepValue | The step value. |
Returns
Type | Description |
---|---|
int | The number of possible steps. |
Overrides
GetValueFromScalarValues(Span<float>)
Get the TValue value from the list of thumb values.
Declaration
protected override Vector2 GetValueFromScalarValues(Span<float> values)
Parameters
Returns
Type | Description |
---|---|
Vector2 | The TValue value. |
Overrides
Mad(int, float, float)
Performs an arithmetic multiply/add operation.
Declaration
protected override float Mad(int m, float a, float b)
Parameters
Type | Name | Description |
---|---|---|
int | m | The number of times to multiply the a value. |
float | a | The value that will be multiplied N times and then added to the base value. |
float | b | The addition value. |
Returns
Type | Description |
---|---|
float | The incremented value. |
Overrides
ParseStringToValue(string, out Vector2)
Method to implement to resolve a string value into a Vector2 value.
You can use Try
Declaration
protected override bool ParseStringToValue(string strValue, out Vector2 val)
Parameters
Returns
Type | Description |
---|---|
bool | True if can be parsed, False otherwise. |
Overrides
ParseSubValueToString(float)
Method to implement to resolve a Vector2 value into a string value.
You can use To
You can also round the value if you want a specific number of decimals.
Declaration
protected override string ParseSubValueToString(float val)
Parameters
Returns
Type | Description |
---|---|
string | The converted value. |
Overrides
ParseValueToString(Vector2)
Method to implement to resolve a Vector2 value into a string value.
You can use To
You can also round the value if you want a specific number of decimals.
Declaration
protected override string ParseValueToString(Vector2 val)
Parameters
Returns
Type | Description |
---|---|
string | The converted value. |
Overrides
SliderLerpUnclamped(float, float, 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 Lerp
Declaration
protected override float SliderLerpUnclamped(float a, float b, float interpolant)
Parameters
Type | Name | Description |
---|---|---|
float | a | The lowest value in the range. |
float | b | The highest value in the range. |
float | interpolant | The normalized value to process. |
Returns
Type | Description |
---|---|
float | The interpolated value. |
Overrides
SliderNormalizeValue(float, float, float)
Method to implement which returns the normalized value of a given value in a specific range.
Usually, you can use directly an Inverse
Declaration
protected override float SliderNormalizeValue(float currentValue, float lowerValue, float higherValue)
Parameters
Type | Name | Description |
---|---|---|
float | currentValue | The value to normalize. |
float | lowerValue | The lowest value in the range. |
float | higherValue | The highest value in the range. |
Returns
Type | Description |
---|---|
float | The normalized value. |