.. default-domain:: py .. highlight:: py .. currentmodule:: UI Container ========= .. class:: Container The base class of canvases and panels, which other objects can be added to. | Base class: :class:`Object` | Derived classes: :class:`Canvas`, :class:`Panel` .. container:: inherited-members .. rubric:: Inherited Members * From :class:`Object`: :attr:`~Object.rect_transform`, :attr:`~Object.layout_element`, :attr:`~Object.visible`, :meth:`~Object.remove` .. method:: add_panel([visible = True]) Add a panel to this object. :param bool visible: Whether the new panel is visible. :rtype: :class:`Panel` .. method:: add_text(content, [visible = True]) Add text to this object. :param str content: The text. :param bool visible: Whether the text is visible. :rtype: :class:`Text` .. method:: add_input_field([visible = True]) Add an input field to this object. :param bool visible: Whether the input field is visible. :rtype: :class:`InputField` .. method:: add_button(content, [visible = True]) Add a button to this object. :param str content: The label for the button. :param bool visible: Whether the button is visible. :rtype: :class:`Button` .. method:: add_toggle(content, [visible = True]) Add a toggle to this object. :param str content: The label for the toggle. :param bool visible: Whether the toggle is visible. :rtype: :class:`Toggle` .. method:: add_toggle_group() Add a toggle group to this object, to make a set of toggles into radio buttons. :rtype: :class:`ToggleGroup` .. 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 = False], [visible = True]) Add a slider to this object. :param bool vertical: Whether the slider runs from bottom to top, rather than from left to right. :param bool visible: Whether the slider is visible. :rtype: :class:`Slider` .. method:: add_dropdown([visible = True]) Add a dropdown to this object. :param bool visible: Whether the dropdown is visible. :rtype: :class:`Dropdown` .. method:: add_image([visible = True]) Add an image to this object. :param bool visible: Whether the image is visible. :rtype: :class:`Image` .. method:: add_scroll_view([visible = True]) Add a scroll view to this object. :param bool visible: Whether the scroll view is visible. :rtype: :class:`ScrollView`