:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SubViewportContainer.xml. .. _class_SubViewportContainer: SubViewportContainer ==================== **Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` A container used for displaying the contents of a :ref:`SubViewport`. .. rst-class:: classref-introduction-group Description ----------- A container that displays the contents of underlying :ref:`SubViewport` child nodes. It uses the combined size of the :ref:`SubViewport`\ s as minimum size, unless :ref:`stretch` is enabled. \ **Note:** Changing a **SubViewportContainer**'s :ref:`Control.scale` will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). \ **Note:** The **SubViewportContainer** forwards mouse-enter and mouse-exit notifications to its sub-viewports. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +------------------------------------------+---------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`FocusMode` | focus_mode | ``1`` (overrides :ref:`Control`) | +------------------------------------------+---------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`mouse_target` | ``false`` | +------------------------------------------+---------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`stretch` | ``false`` | +------------------------------------------+---------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`int` | :ref:`stretch_shrink` | ``1`` | +------------------------------------------+---------------------------------------------------------------------------+---------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_propagate_input_event`\ (\ event\: :ref:`InputEvent`\ ) |virtual| |const| | +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_SubViewportContainer_property_mouse_target: .. rst-class:: classref-property :ref:`bool` **mouse_target** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_mouse_target**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_mouse_target_enabled**\ (\ ) Configure, if either the **SubViewportContainer** or alternatively the :ref:`Control` nodes of its :ref:`SubViewport` children should be available as targets of mouse-related functionalities, like identifying the drop target in drag-and-drop operations or cursor shape of hovered :ref:`Control` node. If ``false``, the :ref:`Control` nodes inside its :ref:`SubViewport` children are considered as targets. If ``true``, the **SubViewportContainer** itself will be considered as a target. .. rst-class:: classref-item-separator ---- .. _class_SubViewportContainer_property_stretch: .. rst-class:: classref-property :ref:`bool` **stretch** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_stretch**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_stretch_enabled**\ (\ ) If ``true``, the sub-viewport will be automatically resized to the control's size. \ **Note:** If ``true``, this will prohibit changing :ref:`SubViewport.size` of its children manually. .. rst-class:: classref-item-separator ---- .. _class_SubViewportContainer_property_stretch_shrink: .. rst-class:: classref-property :ref:`int` **stretch_shrink** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_stretch_shrink**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_stretch_shrink**\ (\ ) Divides the sub-viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering. For example, a 1280×720 sub-viewport with :ref:`stretch_shrink` set to ``2`` will be rendered at 640×360 while occupying the same size in the container. \ **Note:** :ref:`stretch` must be ``true`` for this property to work. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_SubViewportContainer_private_method__propagate_input_event: .. rst-class:: classref-method :ref:`bool` **_propagate_input_event**\ (\ event\: :ref:`InputEvent`\ ) |virtual| |const| :ref:`🔗` **Experimental:** This method may be changed or removed in future versions. Virtual method to be implemented by the user. If it returns ``true``, the ``event`` is propagated to :ref:`SubViewport` children. Propagation doesn't happen if it returns ``false``. If the function is not implemented, all events are propagated to SubViewports. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`