Class RangeSliderInt
Range Slider UI element for integer values.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class RangeSliderInt : RangeSliderBase<Vector2Int, int>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IInputElement<Vector2Int>, IValidatableElement<Vector2Int>, INotifyValueChanging<Vector2Int>, INotifyValueChanged<Vector2Int>
Constructors
RangeSliderInt()
Default constructor.
Declaration
public RangeSliderInt()
Properties
incrementFactor
The increment factor used when the slider is interacted with using the keyboard.
Declaration
public int incrementFactor { get; set; }
Property Value
Type | Description |
---|---|
int |
maxValue
The value of the right handle.
Declaration
public override int maxValue { get; set; }
Property Value
Type | Description |
---|---|
int |
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 int minValue { get; set; }
Property Value
Type | Description |
---|---|
int |
Overrides
Remarks
This is not the same as the lowValue which is the minimum value of the slider.
Methods
Decrement(int)
Method to implement which returns the decrement of a given value.
Declaration
protected override int Decrement(int val)
Parameters
Type | Name | Description |
---|---|---|
int | val | The value to decrement. |
Returns
Type | Description |
---|---|
int | The decremented value. |
Overrides
GetClampedValue(int, int, int)
Get the clamped value.
Declaration
protected override int GetClampedValue(int value, int lowerValue, int higherValue)
Parameters
Type | Name | Description |
---|---|---|
int | value | The value to clamp. |
int | lowerValue | The lower bound. |
int | higherValue | The higher bound. |
Returns
Type | Description |
---|---|
int | The clamped value. |
Overrides
GetMaxValue(Vector2Int)
Get the maximum value from the range value.
Declaration
protected override int GetMaxValue(Vector2Int rangeValue)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | rangeValue | The range value. |
Returns
Type | Description |
---|---|
int | The maximum value of the range. |
Overrides
GetMinValue(Vector2Int)
Get the minimum value from the range value.
Declaration
protected override int GetMinValue(Vector2Int rangeValue)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | rangeValue | The range value. |
Returns
Type | Description |
---|---|
int | The minimum value of the range. |
Overrides
Increment(int)
Method to implement which returns the increment of a given value.
Declaration
protected override int Increment(int val)
Parameters
Type | Name | Description |
---|---|---|
int | val | The value to increment. |
Returns
Type | Description |
---|---|
int | The incremented value. |
Overrides
LerpUnclamped(int, int, float)
Lerp between two values.
Declaration
protected override int LerpUnclamped(int a, int b, float interpolant)
Parameters
Type | Name | Description |
---|---|---|
int | a | The first value. |
int | b | The second value. |
float | interpolant | The interpolant. |
Returns
Type | Description |
---|---|
int | The lerped value. |
Overrides
MakeRangeValue(int, int)
Create a range value from the min and max values.
Declaration
protected override Vector2Int MakeRangeValue(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
int | minValue | The minimum value of the range. |
int | maxValue | The maximum value of the range. |
Returns
Type | Description |
---|---|
Vector2Int | A new range object of type TRangeType. |
Overrides
ParseStringToValue(string, out Vector2Int)
Method to implement to resolve a string value into a TValueType value.
You can use TryParse(string, out float) for floating point value types for example.
Declaration
protected override bool ParseStringToValue(string strValue, out Vector2Int val)
Parameters
Type | Name | Description |
---|---|---|
string | strValue | The string value to convert. |
Vector2Int | val |
Returns
Type | Description |
---|---|
bool | True if can be parsed, False otherwise. |
Overrides
ParseValueToString(Vector2Int)
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(Vector2Int val)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | val | The TValueType value to convert. |
Returns
Type | Description |
---|---|
string |
Overrides
SliderLerpUnclamped(int, int, 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 Vector2Int SliderLerpUnclamped(int a, int b, float interpolant)
Parameters
Type | Name | Description |
---|---|---|
int | a | The lowest value in the range. |
int | b | The highest value in the range. |
float | interpolant | The normalized value to process. |
Returns
Type | Description |
---|---|
Vector2Int |
Overrides
SliderNormalizeValue(int, int, int)
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(int currentValue, int lowerValue, int higherValue)
Parameters
Type | Name | Description |
---|---|---|
int | currentValue | The value to normalize. |
int | lowerValue | The lowest value in the range. |
int | higherValue | The highest value in the range. |
Returns
Type | Description |
---|---|
float |