Constructors
Slider
#Create a slider initialised to a specific number.
Parameters:
| number (UiNumber) | |
| nonLinearity (NonLinearTicks) |
Properties
BackColour
#public Color BackColour { get; set; }
Gets the sets the colour of the slider background. This will also affect the colour of the border, if any.
CustomFormatting
#Gets or sets a custom formatting delegate.
Format
#Gets or sets the value format for the slider grip. The format supports several placeholders:
{0} will be replaced with the standard formatting.
{1} will be replaced with the standard percentile formatting.
{2} will be replaced with the actual value, and as such supports custom formatting hints.
{3} will be replaced with the normalised value, and as such supports custom formatting hints.
{4} will be replaced with the percentage value, and as such supports custom formatting hints.
{5} will be replaced with the non-linear value.
{6} will be replaced with the custom formatting string.
Limits
#Gets the limits and average value of this slider. Note, for the true values, access the Value property.
SlabThickness
#Gets or sets the thickness of the grip. When left at its default (float.NaN) the value is derived from the grip type via SliderLayout.GripThickness / SliderLayout.LabelThickness. Callers that want the slab thickness to match a surrounding canvas shape can assign that thickness here prior to drawing.
Methods
AddPreset
#Add a preset by name and value.
AddPreset
#Add a nameless preset by value.
Parameters:
| value (decimal) | Value of preset. May not exist yet as a preset. |
FormatValue
#format a given value using the Format field. This is the text that the slider displays on the grip.
Parameters:
| value (decimal) | Value to format. |
Returns: Formatted value.
IsPreset
#Gets whether a preset value has already been defined.
Parameters:
| value (decimal) | Value to search for. |
IsPreset
#Gets whether a preset name has already been defined. Name comparison is case sensitive.
Parameters:
| name (string) | Name to search for. |
NearestPreset
#Find the nearest preset.
NearestPreset
#Find the nearest preset.
NextPreset
#Find the first preset strictly larger than the locus.
NextPreset
#Find the first preset strictly larger than the locus.
PreviousPreset
#Find the first preset strictly smaller than the locus.
PreviousPreset
#Find the first preset strictly smaller than the locus.
RemovePreset
#Remove a preset by value.
Parameters:
| value (decimal) | Value of preset to remove. |
Returns: True if preset was removed.
RemovePreset
#Remove all presets with a given name.
Parameters:
| name (string) | Name of preset to remove. |
Returns: True if preset was removed.
RenderCustom
#Render this slider into a graphics context, with optional overrides for various layers.
Parameters:
| context (Context) | Graphics context. |
| drawBack (Action<Context, Slider> = null) | Optional background override. |
| drawRail (Action<Context, Slider> = null) | Optional rail override. |
| drawGrip (Action<Context, Slider> = null) | Optional grip override. |
| drawText (Action<Context, Slider> = null) | Optional text override. |
| drawPopup (Action<Context, Slider> = null) | Optional popup override. |
RenderStandardBack
#Default background render method.
RenderStandardGrip
#Default grip render method.
RenderStandardPopup
#Default numeric popup render method.
RenderStandardRail
#Default rail render method.
RenderStandardText
#Default rail render method.