virtualx-engine-docs/_sources/classes/class_viewportcontainer.rst.txt

87 lines
3.5 KiB
Text
Raw Normal View History

2024-10-23 18:41:33 +02:00
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ViewportContainer.xml.
.. _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.
.. rst-class:: classref-introduction-group
Description
-----------
A :ref:`Container<class_Container>` node that holds a :ref:`Viewport<class_Viewport>`, automatically setting the viewport's size.
\ **Note:** Changing a ViewportContainer's :ref:`Control.rect_scale<class_Control_property_rect_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).
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+-------------------------+------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`stretch<class_ViewportContainer_property_stretch>` | ``false`` |
+-------------------------+------------------------------------------------------------------------+-----------+
| :ref:`int<class_int>` | :ref:`stretch_shrink<class_ViewportContainer_property_stretch_shrink>` | ``1`` |
+-------------------------+------------------------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ViewportContainer_property_stretch:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **stretch** = ``false``
.. rst-class:: classref-property-setget
- void **set_stretch** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_stretch_enabled** **(** **)**
If ``true``, the viewport will be scaled to the control's size.
.. rst-class:: classref-item-separator
----
.. _class_ViewportContainer_property_stretch_shrink:
.. rst-class:: classref-property
:ref:`int<class_int>` **stretch_shrink** = ``1``
.. rst-class:: classref-property-setget
- void **set_stretch_shrink** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **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.
.. |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.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`