{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class BaseSlider<TValueType, THandleValueType> | App UI | 0.5.5
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BaseSlider<TValueType, THandleValueType>

    Base class for any Slider (TouchSliderFloat, TouchSliderInt, SliderFloat, SliderInt).

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    ExVisualElement
    BaseSlider<TValueType, THandleValueType>
    ColorSlider
    RangeSliderBase<TRangeType, TValueType>
    SliderBase<TValueType>
    TouchSlider<TValueType>
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IValidatableElement<TValueType>
    INotifyValueChanging<TValueType>
    INotifyValueChanged<TValueType>
    Inherited Members
    ExVisualElement.contentContainer
    ExVisualElement.outlineColor
    ExVisualElement.backgroundColor
    ExVisualElement.passMask
    VisualElement.disabledUssClassName
    VisualElement.ExecuteDefaultAction(EventBase)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Assembly: solution.dll
    Syntax
    public abstract class BaseSlider<TValueType, THandleValueType> : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IValidatableElement<TValueType>, INotifyValueChanging<TValueType>, INotifyValueChanged<TValueType> where TValueType : IEquatable<TValueType> where THandleValueType : struct, IComparable, IEquatable<THandleValueType>
    Type Parameters
    Name Description
    TValueType

    A comparable value type.

    THandleValueType

    A value type for a single handle of the slider. This can be the same as TValueType.

    Constructors

    Name Description
    BaseSlider()

    Default constructor.

    Fields

    Name Description
    m_DraggerManipulator

    The dragger manipulator used to move the slider.

    m_HighValue

    Slider max value.

    m_LowValue

    Slider min value.

    m_PreviousValue

    The previous value of the slider before the user started interacting with it.

    m_Value

    The current value of the slider.

    Properties

    Name Description
    formatString

    The format string used to display the value of the slider.

    highValue

    Specify the maximum value in the range of this slider.

    invalid

    The invalid state of the slider.

    lowValue

    Specify the minimum value in the range of this slider.

    validateValue

    The validation function used to validate the value of the slider.

    value

    The current value of the slider.

    Methods

    Name Description
    Clamp(TValueType, THandleValueType, THandleValueType)

    Utility method to clamp a TValueType value between specified bounds.

    ClampValue()

    Called when the low or high value has changed and needs to check if the current value fits in this new range.

    ComputeValueFromHandlePosition(float, float)

    Returns the value to set as slider value based on a given dragger position.

    Decrement(THandleValueType)

    Method to implement which returns the decrement of a given value.

    GetClampedValue(TValueType)

    Return the clamped value using current lowValue and highValue values. The method also checks if low and high values are inverted.

    GetSliderRect()

    Returns the rect of the interactive part of the slider.

    Increment(THandleValueType)

    Method to implement which returns the increment of a given value.

    OnGeometryChanged(GeometryChangedEvent)

    Event callback called when the geometry of the slider has changed in the layout.

    OnSliderRangeChanged()

    Called when the low or high value of Slider has changed.

    OnTrackClicked()

    Called when the track has received a click event. Always check if the mouse has moved using hasMoved.

    OnTrackDown(Draggable)

    Event callback called when a pointer down event is received.

    OnTrackDragged(Draggable)

    Event callback called when the dragger is dragged.

    OnTrackUp(Draggable)

    Event callback called when a pointer up event is received.

    ParseHandleValueToString(THandleValueType)

    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.

    ParseStringToValue(string, out TValueType)

    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.

    ParseValueToString(TValueType)

    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.

    SetValueFromDrag(float)

    Custom implementation of the slider value from the drag position.

    SetValueWithoutNotify(TValueType)

    Set the value of the slider without sending any event.

    SliderLerpUnclamped(THandleValueType, THandleValueType, 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.

    SliderNormalizeValue(THandleValueType, THandleValueType, THandleValueType)

    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.

    Extension Methods

    NotifyValueChangingExtensions.RegisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    NotifyValueChangingExtensions.UnregisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    VisualElementExtensions.FindNavController(VisualElement)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContext(VisualElement)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.GetWorldBoundingBox(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, PopoverPlacement)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)