Skip to Main Content

BTD_Mod_Helper​.Api​.Components​.ModHelperSlider


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.Components

ModHelperSlider Class

ModHelperComponent for a sliding input

public class ModHelperSlider : BTD_Mod_Helper.Api.Components.ModHelperComponent

Inheritance UnityEngine.MonoBehaviourModHelperComponent  ModHelperSlider

Fields

ModHelperSlider.defaultValue Field

The Default value, not scaled to anything

public float defaultValue;

Field Value

System.Single

Properties

ModHelperSlider.CurrentValue Property

The real current value, scaled by the appropriate scale factor

private float CurrentValue { get; }

Property Value

System.Single

ModHelperSlider.DefaultNotch Property

The image showing where the default value is on the slider

public BTD_Mod_Helper.Api.Components.ModHelperImage DefaultNotch { get; }

Property Value

ModHelperImage

ModHelperSlider.Fill Property

The panel that's the filled up bar part of the slider

public BTD_Mod_Helper.Api.Components.ModHelperPanel Fill { get; }

Property Value

ModHelperPanel

ModHelperSlider.Label Property

The text that's on the notch of the slider

public BTD_Mod_Helper.Api.Components.ModHelperText Label { get; }

Property Value

ModHelperText

ModHelperSlider.MaxValue Property

The min value of this slider, adjusted for internal scale factor

private float MaxValue { get; }

Property Value

System.Single

ModHelperSlider.MinValue Property

The min value of this slider, adjusted for internal scale factor

private float MinValue { get; }

Property Value

System.Single

ModHelperSlider.ScaleFactor Property

The scale factor used for the step size of this slider

public float ScaleFactor { get; set; }

Property Value

System.Single

ModHelperSlider.Slider Property

The actual Slider component

public Slider Slider { get; }

Property Value

UnityEngine.UI.Slider

Methods

ModHelperSlider.Create(Info, float, float, float, float, Vector2, UnityAction, float, string, Nullable) Method

Creates a new ModHelperSlider

public static BTD_Mod_Helper.Api.Components.ModHelperSlider Create(BTD_Mod_Helper.Api.Components.Info info, float defaultValue, float minValue, float maxValue, float stepSize, Vector2 handleSize, UnityAction<float> onValueChanged=null, float fontSize=42f, string labelSuffix="", System.Nullable<float> startingValue=null);

Parameters

info Info

The name/position/size info. NOTE: height must be a set value

defaultValue System.Single

The default slider amount

minValue System.Single

The minimum value of the slider

maxValue System.Single

The maximum value of the slider

stepSize System.Single

What value the slider should increase by per tick

handleSize UnityEngine.Vector2

The height and width of the pip

onValueChanged UnityEngine.Events.UnityAction

Action should happen when the slider changes value, or null

fontSize System.Single

The size of the label text

labelSuffix System.String

String to add to the end of the label, e.g. "%"

startingValue System.Nullable<System.Single>

If not null, the value that this should start as instead of the default

Returns

ModHelperSlider

ModHelperSlider.SetCurrentValue(float, bool) Method

Sets the current value of this

public void SetCurrentValue(float value, bool sendCallback=true);

Parameters

value System.Single

The new value

sendCallback System.Boolean

Whether the onValueChanged listener should fire

To learn how to download BTD Mod Helper and install mods, click here