.. default-domain:: lua .. highlight:: lua .. currentmodule:: UI Dropdown ======== .. class:: Dropdown A control for choosing one of a list of options, which are shown when it is clicked. Added to a :class:`UI.Canvas` or a :class:`UI.Panel`. | Base class: :class:`UI.InputControl` .. container:: inherited-members .. rubric:: Inherited Members * From :class:`UI.InputControl`: :attr:`changed ` * From :class:`UI.Control`: :attr:`interactable `, :attr:`color `, :attr:`tooltip ` * From :class:`UI.Object`: :attr:`rect_transform `, :attr:`layout_element `, :attr:`visible `, :meth:`remove ` .. attribute:: options: List The options that the dropdown offers. :Attribute: Can be read or written .. note:: Setting the options resets the selection to the first of them, or to nothing when the list is empty. .. attribute:: selected_index: number The position in :attr:`UI.Dropdown.options` of the option that is chosen. :Attribute: Can be read or written .. note:: Zero while the dropdown has no options, as there is nothing to choose.