.. default-domain:: js .. highlight:: js .. module:: UI :no-index: 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`: :meth:`getRectTransform `, :meth:`getLayoutElement `, :meth:`getVisible `, :meth:`setVisible `, :meth:`remove ` .. method:: addPanel([visible]) Add a panel to this object. :param visible: Whether the new panel is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.Panel` .. method:: addText(content[, visible]) Add text to this object. :param content: The text. :type content: ``string`` :param visible: Whether the text is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.Text` .. method:: addInputField([visible]) Add an input field to this object. :param visible: Whether the input field is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.InputField` .. method:: addButton(content[, visible]) Add a button to this object. :param content: The label for the button. :type content: ``string`` :param visible: Whether the button is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.Button` .. method:: addToggle(content[, visible]) Add a toggle to this object. :param content: The label for the toggle. :type content: ``string`` :param visible: Whether the toggle is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.Toggle` .. method:: addToggleGroup() Add a toggle group to this object, to make a set of toggles into radio buttons. :rtype: :class:`UI.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:: addSlider([vertical[, visible]]) 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``. :type vertical: ``boolean`` :param visible: Whether the slider is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.Slider` .. method:: addDropdown([visible]) Add a dropdown to this object. :param visible: Whether the dropdown is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.Dropdown` .. method:: addImage([visible]) Add an image to this object. :param visible: Whether the image is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.Image` .. method:: addScrollView([visible]) Add a scroll view to this object. :param visible: Whether the scroll view is visible. Defaults to ``true``. :type visible: ``boolean`` :rtype: :class:`UI.ScrollView`