Files
godot-docs/classes/class_viewportcontainer.rst
Rémi Verschelde 782dd64a19 classref: Use code markup for default values/overrides
Sync with godotengine/godot#35357.
Fixes #3071.
2020-01-20 12:41:39 +01:00

67 lines
2.5 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the ViewportContainer.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_ViewportContainer:
ViewportContainer
=================
**Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Control for holding :ref:`Viewport<class_Viewport>`\ s.
Description
-----------
A :ref:`Container<class_Container>` node that holds a :ref:`Viewport<class_Viewport>`, automatically setting its size.
Properties
----------
+-------------------------+------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`stretch<class_ViewportContainer_property_stretch>` | ``false`` |
+-------------------------+------------------------------------------------------------------------+-----------+
| :ref:`int<class_int>` | :ref:`stretch_shrink<class_ViewportContainer_property_stretch_shrink>` | ``1`` |
+-------------------------+------------------------------------------------------------------------+-----------+
Property Descriptions
---------------------
.. _class_ViewportContainer_property_stretch:
- :ref:`bool<class_bool>` **stretch**
+-----------+----------------------+
| *Default* | ``false`` |
+-----------+----------------------+
| *Setter* | set_stretch(value) |
+-----------+----------------------+
| *Getter* | is_stretch_enabled() |
+-----------+----------------------+
If ``true``, the viewport will be scaled to the control's size.
----
.. _class_ViewportContainer_property_stretch_shrink:
- :ref:`int<class_int>` **stretch_shrink**
+-----------+---------------------------+
| *Default* | ``1`` |
+-----------+---------------------------+
| *Setter* | set_stretch_shrink(value) |
+-----------+---------------------------+
| *Getter* | get_stretch_shrink() |
+-----------+---------------------------+
Divides the viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering.
For example, a 1280×720 viewport with :ref:`stretch_shrink<class_ViewportContainer_property_stretch_shrink>` set to ``2`` will be rendered at 640×360 while occupying the same size in the container.
**Note:** :ref:`stretch<class_ViewportContainer_property_stretch>` must be ``true`` for this property to work.