Method SliderInt
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
SliderInt(string?, int?, int?, int?, Action<int>?, string?, string?, bool?, Func<VisualElement, Action>?, Action<VisualElement>?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, SliderDirection?, bool?, int?, FiberEventBinding[]?)
Creates a SliderInt: Slider(string?, float?, float?, float?, Action<float>?, string?, string?, bool?, Func<VisualElement, Action>?, Action<VisualElement>?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, SliderDirection?, bool?, float?, FiberEventBinding[]?) over whole numbers, reporting an int.
public static ElementNode SliderInt(string? className = null, int? value = null, int? lowValue = null, int? highValue = null, Action<int>? onValueChanged = null, string? key = null, string? name = null, bool? enabled = null, Func<VisualElement, Action>? refCallback = null, Action<VisualElement>? onCreated = null, string? whileHoverClass = null, string? whileTapClass = null, string? whileFocusClass = null, IReadOnlyDictionary<string, string>? data = null, IReadOnlyDictionary<string, string>? aria = null, SliderDirection? direction = null, bool? inverted = null, int? step = null, FiberEventBinding[]? events = null)
Parameters
classNamestringCSS-like utility class string. Multiple classes separated by spaces.
valueint?Current slider value (controlled).
lowValueint?Minimum value of the slider range.
highValueint?Maximum value of the slider range.
onValueChangedAction<int>Handler invoked when the slider value changes.
keystringKey used to disambiguate siblings at the same position.
namestringElement name assigned to UnityEngine.UIElements.VisualElement.name for query/debug.
enabledbool?When false, disables the slider input.
refCallbackFunc<VisualElement, Action>Callback invoked on mount with the created VisualElement; returned Action runs on unmount.
onCreatedAction<VisualElement>Callback invoked once when the SliderInt VisualElement is first created.
whileHoverClassstringUSS class toggled while the pointer hovers the element.
whileTapClassstringUSS class toggled while the pointer is pressed on the element.
whileFocusClassstringUSS class toggled while the element holds keyboard/UI focus.
dataIReadOnlyDictionary<string, string>data-* attribute map matched by
data-[...]variants.ariaIReadOnlyDictionary<string, string>aria-* attribute map matched by
aria-[...]variants.directionSliderDirection?Axis the slider runs along, as Slider(string?, float?, float?, float?, Action<float>?, string?, string?, bool?, Func<VisualElement, Action>?, Action<VisualElement>?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, SliderDirection?, bool?, float?, FiberEventBinding[]?)'s
direction.invertedbool?When true, swaps the ends the low and high values sit at, as Slider(string?, float?, float?, float?, Action<float>?, string?, string?, bool?, Func<VisualElement, Action>?, Action<VisualElement>?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, SliderDirection?, bool?, float?, FiberEventBinding[]?)'s
inverted.stepint?Distance one arrow key moves the value, and the grid Home, End and the paging keys land on, counted from
lowValue. Null is Radix's default of 1.eventsFiberEventBinding[]Event bindings applied to the element (
Documentation~/react-migration.mdowns the rule). The array is read and never written.
Returns
- ElementNode
The created ElementNode representing this slider.
Exceptions
- ArgumentOutOfRangeException
directionnames no member of UnityEngine.UIElements.SliderDirection, orstepis not above zero.