Class TouchSlider<TValue>
Base class for TouchSlider UI elements (TouchSliderFloat, TouchSliderInt).
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public abstract class TouchSlider<TValue> : BaseSlider<TValue, TValue>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<TValue>, IValidatableElement<TValue>, INotifyValueChanging<TValue>, INotifyValueChanged<TValue>, IFormattable<TValue> where TValue : unmanaged, IComparable, IEquatable<TValue>
Type Parameters
| Name | Description |
|---|---|
| TValue | A comparable value type. |
Constructors
TouchSlider()
Default constructor.
Declaration
protected TouchSlider()
Fields
labelContainerUssClassName
The TouchSlider label container styling class.
Declaration
public const string labelContainerUssClassName = "appui-touchslider__label-container"
Field Value
| Type | Description |
|---|---|
| string |
labelUssClassName
The TouchSlider label styling class.
Declaration
public const string labelUssClassName = "appui-touchslider__label"
Field Value
| Type | Description |
|---|---|
| string |
progressUssClassName
The TouchSlider progress styling class.
Declaration
public const string progressUssClassName = "appui-touchslider__progress"
Field Value
| Type | Description |
|---|---|
| string |
sizeUssClassName
The TouchSlider size styling class.
Declaration
public const string sizeUssClassName = "appui-touchslider--size-"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The TouchSlider main styling class.
Declaration
public const string ussClassName = "appui-touchslider"
Field Value
| Type | Description |
|---|---|
| string |
valueContainerUssClassName
The TouchSlider value label container styling class.
Declaration
public const string valueContainerUssClassName = "appui-touchslider__valuelabel-container"
Field Value
| Type | Description |
|---|---|
| string |
valueUssClassName
The TouchSlider value label styling class.
Declaration
public const string valueUssClassName = "appui-touchslider__valuelabel"
Field Value
| Type | Description |
|---|---|
| string |
variantUssClassName
The orientation variant USS class name.
Declaration
public const string variantUssClassName = "appui-touchslider--"
Field Value
| Type | Description |
|---|---|
| string |
Properties
contentContainer
The content container of this element.
Declaration
public override VisualElement contentContainer { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Overrides
label
Specify a unit for the value encapsulated in this slider.
This unit will be displayed next to value into the slider.
Declaration
public string label { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
size
Specify the size of the slider.
Declaration
public Size size { get; set; }
Property Value
| Type | Description |
|---|---|
| Size |
Methods
Clamp(TValue, TValue, TValue)
Utility method to clamp a TValue value between specified bounds.
Declaration
protected override TValue Clamp(TValue v, TValue lowBound, TValue highBound)
Parameters
| Type | Name | Description |
|---|---|---|
| TValue | v | The value to clamp. |
| TValue | lowBound | Minimum |
| TValue | highBound | Maximum |
Returns
| Type | Description |
|---|---|
| TValue | The clamped value. |
Overrides
GetOrientationClassName(Direction)
Declaration
public static string GetOrientationClassName(Direction enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Direction | enumValue |
Returns
| Type | Description |
|---|---|
| string |
GetSizeUssClassName(Size)
Declaration
public static string GetSizeUssClassName(Size enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | enumValue |
Returns
| Type | Description |
|---|---|
| string |
OnTrackClicked()
Callback when the interactive part of the slider is clicked.
Declaration
protected override void OnTrackClicked()
Overrides
SetOrientation(Direction)
Called when the orientation of the slider has changed.
Declaration
protected override void SetOrientation(Direction newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Direction | newValue | The new orientation value. |
Overrides
SetValueWithoutNotify(TValue)
Set the value of the slider without notifying the value change.
Declaration
public override void SetValueWithoutNotify(TValue newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| TValue | newValue | The new value to set. |