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 : RangeSliderBase<Vector2, float>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<Vector2>, IValidatableElement<Vector2>, INotifyValueChanging<Vector2>, INotifyValueChanged<Vector2>
Constructors
RangeSliderFloat()
Default constructor.
Declaration
public RangeSliderFloat()
Properties
incrementFactor
The increment factor used when the slider is interacted with using the keyboard.
Declaration
public float incrementFactor { get; set; }
Property Value
Type | Description |
---|---|
float |
maxValue
The value of the right handle.
Declaration
public override float maxValue { get; set; }
Property Value
Type | Description |
---|---|
float |
Overrides
Remarks
This is not the same as the highValue which is the maximum value of the slider.
minValue
The value of the left handle.
Declaration
public override float minValue { get; set; }
Property Value
Type | Description |
---|---|
float |
Overrides
Remarks
This is not the same as the lowValue which is the minimum value of the slider.
Methods
Decrement(float)
Method to implement which returns the decrement of a given value.
Declaration
protected override float Decrement(float val)
Parameters
Type | Name | Description |
---|---|---|
float | val | The value to decrement. |
Returns
Type | Description |
---|---|
float | The decremented value. |
Overrides
GetClampedValue(float, float, float)
Get the clamped value.
Declaration
protected override float GetClampedValue(float value, float lowerValue, float higherValue)
Parameters
Type | Name | Description |
---|---|---|
float | value | The value to clamp. |
float | lowerValue | The lower bound. |
float | higherValue | The higher bound. |
Returns
Type | Description |
---|---|
float | The clamped value. |
Overrides
GetMaxValue(Vector2)
Get the maximum value from the range value.
Declaration
protected override float GetMaxValue(Vector2 rangeValue)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | rangeValue | The range value. |
Returns
Type | Description |
---|---|
float | The maximum value of the range. |
Overrides
GetMinValue(Vector2)
Get the minimum value from the range value.
Declaration
protected override float GetMinValue(Vector2 rangeValue)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | rangeValue | The range value. |
Returns
Type | Description |
---|---|
float | The minimum value of the range. |
Overrides
Increment(float)
Method to implement which returns the increment of a given value.
Declaration
protected override float Increment(float val)
Parameters
Type | Name | Description |
---|---|---|
float | val | The value to increment. |
Returns
Type | Description |
---|---|
float | The incremented value. |
Overrides
LerpUnclamped(float, float, float)
Lerp between two values.
Declaration
protected override float LerpUnclamped(float a, float b, float interpolant)
Parameters
Type | Name | Description |
---|---|---|
float | a | The first value. |
float | b | The second value. |
float | interpolant | The interpolant. |
Returns
Type | Description |
---|---|
float | The lerped value. |
Overrides
MakeRangeValue(float, float)
Create a range value from the min and max values.
Declaration
protected override Vector2 MakeRangeValue(float minValue, float maxValue)
Parameters
Type | Name | Description |
---|---|---|
float | minValue | The minimum value of the range. |
float | maxValue | The maximum value of the range. |
Returns
Type | Description |
---|---|
Vector2 | A new range value. |
Overrides
ParseStringToValue(string, out Vector2)
Declaration
protected override bool ParseStringToValue(string strValue, out Vector2 val)
Parameters
Type | Name | Description |
---|---|---|
string | strValue | |
Vector2 | val |
Returns
Type | Description |
---|---|
bool |
Overrides
ParseValueToString(Vector2)
Method to implement to resolve a TValueType value into a string value.
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.
Declaration
protected override string ParseValueToString(Vector2 val)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | val | The TValueType value to convert. |
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 LerpUnclamped(float, float, float) for floating point value types.
Declaration
protected override Vector2 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 |
---|---|
Vector2 | 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 InverseLerp(float, float, float) for floating point value types.
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. |