Skip to Main Content

BTD_Mod_Helper​.Api​.Components​.ModHelperCheckbox


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.Components

ModHelperCheckbox Class

ModHelperComponent for a Checkbox

public class ModHelperCheckbox : BTD_Mod_Helper.Api.Components.ModHelperComponent

Inheritance UnityEngine.MonoBehaviourModHelperComponent  ModHelperCheckbox

Properties

ModHelperCheckbox.Check Property

The ModHelperImage for the Checkmark

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

Property Value

ModHelperImage

ModHelperCheckbox.CurrentValue Property

Whether it is currently checked or not

public bool CurrentValue { get; }

Property Value

System.Boolean

ModHelperCheckbox.Toggle Property

The Toggle component

public Toggle Toggle { get; }

Property Value

UnityEngine.UI.Toggle

Methods

ModHelperCheckbox.Create(Info, bool, string, UnityAction, string, int) Method

Creates a new ModHelperCheckbox

public static BTD_Mod_Helper.Api.Components.ModHelperCheckbox Create(BTD_Mod_Helper.Api.Components.Info info, bool defaultValue, string background, UnityAction<bool> onValueChanged=null, string checkImage=null, int padding=0);

Parameters

info Info

The name/position/size info

defaultValue System.Boolean

If it starts out checked or not

background System.String

The background behind the check, or null for nothing

onValueChanged UnityEngine.Events.UnityAction

Action to perform when it is checked/unchecked, or null

checkImage System.String

The checkmark itself, or null for the default checkmark

padding System.Int32

How much space around the outside of the check there is

Returns

ModHelperCheckbox
The new ModHelperCheckbox

ModHelperCheckbox.SetChecked(bool, bool) Method

Sets the current value of this

public void SetChecked(bool isChecked, bool sendCallback=true);

Parameters

isChecked System.Boolean

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