Scripting API

TMP_Dropdown

class in TMPro · Unity.TextMeshPro · inherits from Selectable

29 of 32 of Unity's members
In Tassix

TextMeshPro's dropdown: a button showing the chosen option; pressed, it opens a list of all of them (a copy of its template, on top of everything, with a blocker behind that closes it). Picking one sets value and closes the list.

Properties 10

bool IsExpanded { get; }
float alphaFadeSpeed { get; set; }
Image? captionImage { get; set; }
TMP_Text? captionText { get; set; }
Image? itemImage { get; set; }
TMP_Text? itemText { get; set; }
DropdownEvent onValueChanged { get; set; }
List<OptionData> options { get; set; }
RectTransform? template { get; set; }
int value { get; set; }

Methods 9

void AddOptions(List<OptionData> options)
void AddOptions(List<string> options)
void AddOptions(List<Sprite> options)
void ClearOptions()
void Hide()

Closes the list (fading out, then destroyed) and the blocker, and selects the dropdown again.

virtual void OnCancel(BaseEventData eventData)
virtual void OnPointerClick(PointerEventData eventData)
virtual void OnSubmit(BaseEventData eventData)
void RefreshShownValue()

Shows the chosen option's text and image in the caption.

void SetValueWithoutNotify(int input)
void Show()

Opens the list: the template copied with an item per option, the chosen one on.

Not in Tassix yet 3

MultiSelect OnValidate placeholder