:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the SubViewportContainer.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_SubViewportContainer: SubViewportContainer ==================== **Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` Control for holding :ref:`SubViewport`\ s. Description ----------- A :ref:`Container` node that holds a :ref:`SubViewport`. It uses the :ref:`SubViewport`'s size 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. Properties ---------- +-------------------------+---------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`stretch` | ``false`` | +-------------------------+---------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`stretch_shrink` | ``1`` | +-------------------------+---------------------------------------------------------------------------+-----------+ Property Descriptions --------------------- .. _class_SubViewportContainer_property_stretch: - :ref:`bool` **stretch** +-----------+----------------------+ | *Default* | ``false`` | +-----------+----------------------+ | *Setter* | set_stretch(value) | +-----------+----------------------+ | *Getter* | is_stretch_enabled() | +-----------+----------------------+ If ``true``, the sub-viewport will be automatically resized to the control's size. ---- .. _class_SubViewportContainer_property_stretch_shrink: - :ref:`int` **stretch_shrink** +-----------+---------------------------+ | *Default* | ``1`` | +-----------+---------------------------+ | *Setter* | set_stretch_shrink(value) | +-----------+---------------------------+ | *Getter* | 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. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |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.)`