Class TMP_Dropdown
Implements
Inherited Members
Namespace: TMPro
Assembly: solution.dll
Syntax
[AddComponentMenu("UI/Dropdown - TextMeshPro", 35)]
[RequireComponent(typeof(RectTransform))]
public class TMP_Dropdown : Selectable, IMoveHandler, IPointerDownHandler, IPointerUpHandler, IPointerEnterHandler, IPointerExitHandler, ISelectHandler, IDeselectHandler, IPointerClickHandler, ISubmitHandler, ICancelHandler, IEventSystemHandler
Constructors
Name | Description |
---|---|
TMP_Dropdown() |
Properties
Name | Description |
---|---|
Is |
|
alpha |
The time interval at which a drop down will appear and disappear |
caption |
The Image component to hold the image of the currently selected option. |
caption |
The Text component to hold the text of the currently selected option. |
item |
The Image component to hold the image of the item |
item |
The Text component to hold the text of the item. |
on |
|
options | |
placeholder | The placeholder Graphic component. Shown when no option is selected. |
template | The Rect Transform of the template for the dropdown list. |
value |
Methods
Name | Description |
---|---|
Add |
|
Add |
|
Add |
|
Awake() | |
Clear |
Clear the list of options in the Dropdown. |
Create |
Create a blocker that blocks clicks to other controls while the dropdown list is open. |
Create |
Create the dropdown list to be shown when the dropdown is clicked. The dropdown list should correspond to the provided template GameObject, equivalent to instantiating a copy of it. |
Create |
Create a dropdown item based upon the item template. |
Destroy |
Convenience method to explicitly destroy the previously generated blocker object |
Destroy |
Convenience method to explicitly destroy the previously generated dropdown list |
Destroy |
Convenience method to explicitly destroy the previously generated Items. |
Hide() | Hide the dropdown list. I.e. close it. |
On |
This will hide the dropdown list. |
On |
|
On |
Handling for when the dropdown is initially 'clicked'. Typically shows the dropdown |
On |
Handling for when the dropdown is selected and a submit event is processed. Typically shows the dropdown |
Refresh |
Refreshes the text and image (if available) of the currently selected option. |
Set |
Set index number of the current selection in the Dropdown without invoking onValueChanged callback. |
Show() | Show the dropdown. Plan for dropdown scrolling to ensure dropdown is contained within screen. We assume the Canvas is the screen that the dropdown must be kept inside. This is always valid for screen space canvas modes. For world space canvases we don't know how it's used, but it could be e.g. for an in-game monitor. We consider it a fair constraint that the canvas must be big enough to contain dropdowns. |
Start() |