Class SliderInt
Slider UI element for integer values.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class SliderInt : Slider<int, int, IntField>, IEventHandler, IVisualElementScheduler, IExperimentalFeatures, ITransitionAnimations, ITransform, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<int>, IValidatableElement<int>, INotifyValueChanging<int>, INotifyValueChanged<int>, IFormattable<int>
Constructors
SliderInt()
Default constructor.
Declaration
public SliderInt()
Properties
thumbCount
Get the number of thumbs for this slider.
Declaration
protected override int thumbCount { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Methods
ClampThumb(int, int, int)
Clamp the thumb value.
Declaration
protected override int ClampThumb(int x, int min, int max)
Parameters
Type | Name | Description |
---|---|---|
int | x | The value to clamp. |
int | min | The minimum value. |
int | max | The maximum value. |
Returns
Type | Description |
---|---|
int | The clamped values. |
Overrides
GetScalarValuesFromValue(int, Span<int>)
Get the list of thumb values from the TValue value. This must be sorted.
Declaration
protected override void GetScalarValuesFromValue(int v, Span<int> values)
Parameters
Overrides
GetStepCount(int)
Declaration
protected override int GetStepCount(int stepValue)
Parameters
Type | Name | Description |
---|---|---|
int | stepValue | The step value. |
Returns
Type | Description |
---|---|
int | The number of possible steps. |
Overrides
GetValueFromScalarValues(Span<int>)
Get the TValue value from the list of thumb values.
Declaration
protected override int GetValueFromScalarValues(Span<int> values)
Parameters
Returns
Type | Description |
---|---|
int | The TValue value. |
Overrides
Mad(int, int, int)
Performs an arithmetic multiply/add operation.
Declaration
protected override int Mad(int m, int a, int b)
Parameters
Type | Name | Description |
---|---|---|
int | m | The number of times to multiply the a value. |
int | a | The value that will be multiplied N times and then added to the base value. |
int | b | The addition value. |
Returns
Type | Description |
---|---|
int | The incremented value. |
Overrides
ParseStringToValue(string, out int)
Method to implement to resolve a string value into a int value.
You can use Try
Declaration
protected override bool ParseStringToValue(string strValue, out int v)
Parameters
Returns
Type | Description |
---|---|
bool | True if can be parsed, False otherwise. |
Overrides
ParseSubValueToString(int)
Method to implement to resolve a int 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(int val)
Parameters
Returns
Type | Description |
---|---|
string | The converted value. |
Overrides
ParseValueToString(int)
Method to implement to resolve a int 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(int val)
Parameters
Returns
Type | Description |
---|---|
string | The converted value. |
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 Lerp
Declaration
protected override int 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 |
---|---|
int | The interpolated value. |
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 Inverse
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 | The normalized value. |