Skip to Main Content

BTD_Mod_Helper​.Api​.Components​.ModHelperPopdown


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.Components

ModHelperPopdown Class

A ModHelperComponent for a dropdown menu that utilizes a ModHelperPopupMenu

public class ModHelperPopdown : BTD_Mod_Helper.Api.Components.ModHelperPanel

Inheritance UnityEngine.MonoBehaviourModHelperComponentModHelperPanel  ModHelperPopdown

Fields

ModHelperPopdown.autosize Field

Whether to automatically size the component that opens the dropdown based on the text width

public bool autosize;

Field Value

System.Boolean

ModHelperPopdown.dropdown Field

The component which handles the dropdown

public TMP_Dropdown dropdown;

Field Value

Il2CppTMPro.TMP_Dropdown

ModHelperPopdown.menu Field

The popup menu used

public ModHelperPopupMenu menu;

Field Value

ModHelperPopupMenu

Methods

ModHelperPopdown.Create(Info, Vector2, List, UnityAction, Vector2, float, string, Vector2, List, bool) Method

Constructs a new popup menu dropdown

public static BTD_Mod_Helper.Api.Components.ModHelperPopdown Create(BTD_Mod_Helper.Api.Components.Info info, Vector2 itemSize, List<string> options, UnityAction<int> onValueChanged, Vector2 direction=default(Vector2), float labelFontSize=42f, string background=null, Vector2 menuOffset=default(Vector2), List<string> images=null, bool autosize=false);

Parameters

info Info

the initial info to use, should have a Height defined

itemSize UnityEngine.Vector2

size of each option in the popup menu (before margins/padding)

options Il2CppSystem.Collections.Generic.List

the labels for the options

onValueChanged UnityEngine.Events.UnityAction

called when an option is selected, index passed in

direction UnityEngine.Vector2

the direction of the dropdown, Vector2.down or Vector2.up will be the most used

labelFontSize System.Single

text size for label

background System.String

background image, or null

menuOffset UnityEngine.Vector2

position offset for the menu

images Il2CppSystem.Collections.Generic.List

images guids to use for the options

autosize System.Boolean

autosize

Returns

ModHelperPopdown
the created popdown

ModHelperPopdown.OnUpdate() Method

Unity Component OnUpdate

protected override void OnUpdate();
To learn how to download BTD Mod Helper and install mods, click here