.. default-domain:: http .. highlight:: json Container ========= .. _http-UI.Container: .. rubric:: Container The base class of canvases and panels, which other objects can be added to. | Base class: :ref:`Object ` | Derived classes: :ref:`Canvas `, :ref:`Panel ` A ``Container`` object is returned as ``{"id": ..., "class": ...}``, its identifier and the name of its own class. An argument is that object or the identifier alone. A path that acts on an object takes the identifier as ``(id)``. .. http:get:: /ui/container/(id)/rect-transform The rect transform for the UI object. Inherited from :ref:`Object `. :param id: The identifier of the :ref:`Container ` object. :resjson UI.RectTransform value: .. http:get:: /ui/container/(id)/layout-element How much space the UI object asks a layout for. Inherited from :ref:`Object `. .. note:: Only has an effect when the object is in a panel that has a layout. A canvas is not inside a layout and does not have one. :param id: The identifier of the :ref:`Container ` object. :resjson UI.LayoutElement value: .. http:get:: /ui/container/(id)/visible Whether the UI object is visible. Inherited from :ref:`Object `. .. note:: This is the object's own setting, which is what it was last set to. An object is only drawn when everything it is inside is visible as well, so an interface can be built with its parts visible, inside a panel that is not, and shown all at once by making that panel visible. :param id: The identifier of the :ref:`Container ` object. :resjson bool value: .. http:put:: /ui/container/(id)/visible Whether the UI object is visible. Inherited from :ref:`Object `. .. note:: This is the object's own setting, which is what it was last set to. An object is only drawn when everything it is inside is visible as well, so an interface can be built with its parts visible, inside a panel that is not, and shown all at once by making that panel visible. :param id: The identifier of the :ref:`Container ` object. :reqjson bool value: The new value. .. http:post:: /ui/container/(id)/add-panel Add a panel to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson bool visible: Whether the new panel is visible. Optional, defaults to ``true``. :resjson UI.Panel value: .. http:post:: /ui/container/(id)/add-text Add text to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson string content: The text. :reqjson bool visible: Whether the text is visible. Optional, defaults to ``true``. :resjson UI.Text value: .. http:post:: /ui/container/(id)/add-input-field Add an input field to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson bool visible: Whether the input field is visible. Optional, defaults to ``true``. :resjson UI.InputField value: .. http:post:: /ui/container/(id)/add-button Add a button to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson string content: The label for the button. :reqjson bool visible: Whether the button is visible. Optional, defaults to ``true``. :resjson UI.Button value: .. http:post:: /ui/container/(id)/add-toggle Add a toggle to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson string content: The label for the toggle. :reqjson bool visible: Whether the toggle is visible. Optional, defaults to ``true``. :resjson UI.Toggle value: .. http:post:: /ui/container/(id)/add-toggle-group 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. :param id: The identifier of the :ref:`Container ` object. :resjson UI.ToggleGroup value: .. http:post:: /ui/container/(id)/add-slider Add a slider to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson bool vertical: Whether the slider runs from bottom to top, rather than from left to right. Optional, defaults to ``false``. :reqjson bool visible: Whether the slider is visible. Optional, defaults to ``true``. :resjson UI.Slider value: .. http:post:: /ui/container/(id)/add-dropdown Add a dropdown to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson bool visible: Whether the dropdown is visible. Optional, defaults to ``true``. :resjson UI.Dropdown value: .. http:post:: /ui/container/(id)/add-image Add an image to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson bool visible: Whether the image is visible. Optional, defaults to ``true``. :resjson UI.Image value: .. http:post:: /ui/container/(id)/add-scroll-view Add a scroll view to this object. :param id: The identifier of the :ref:`Container ` object. :reqjson bool visible: Whether the scroll view is visible. Optional, defaults to ``true``. :resjson UI.ScrollView value: .. http:post:: /ui/container/(id)/remove Remove the UI object. Inherited from :ref:`Object `. :param id: The identifier of the :ref:`Container ` object.