.. default-domain:: lua .. highlight:: lua .. currentmodule:: UI Container ========= .. class:: Container The base class of canvases and panels, which other objects can be added to. | Base class: :class:`UI.Object` | Derived classes: :class:`UI.Canvas`, :class:`UI.Panel` .. container:: inherited-members .. rubric:: Inherited Members * From :class:`UI.Object`: :attr:`rect_transform `, :attr:`layout_element `, :attr:`visible `, :meth:`remove ` .. method:: add_panel(visible?: boolean): UI.Panel Add a panel to this object. :param visible: Whether the new panel is visible. Defaults to ``true``. .. method:: add_text(content: string, visible?: boolean): UI.Text Add text to this object. :param content: The text. :param visible: Whether the text is visible. Defaults to ``true``. .. method:: add_input_field(visible?: boolean): UI.InputField Add an input field to this object. :param visible: Whether the input field is visible. Defaults to ``true``. .. method:: add_button(content: string, visible?: boolean): UI.Button Add a button to this object. :param content: The label for the button. :param visible: Whether the button is visible. Defaults to ``true``. .. method:: add_toggle(content: string, visible?: boolean): UI.Toggle Add a toggle to this object. :param content: The label for the toggle. :param visible: Whether the toggle is visible. Defaults to ``true``. .. method:: add_toggle_group(): UI.ToggleGroup Add a toggle group to this object, to make a set of toggles into radio buttons. .. note:: The group is not drawn and does not take up any space. The toggles that belong to it can be added anywhere. .. method:: add_slider(vertical?: boolean, visible?: boolean): UI.Slider Add a slider to this object. :param vertical: Whether the slider runs from bottom to top, rather than from left to right. Defaults to ``false``. :param visible: Whether the slider is visible. Defaults to ``true``. .. method:: add_dropdown(visible?: boolean): UI.Dropdown Add a dropdown to this object. :param visible: Whether the dropdown is visible. Defaults to ``true``. .. method:: add_image(visible?: boolean): UI.Image Add an image to this object. :param visible: Whether the image is visible. Defaults to ``true``. .. method:: add_scroll_view(visible?: boolean): UI.ScrollView Add a scroll view to this object. :param visible: Whether the scroll view is visible. Defaults to ``true``.