class_viewportcontainer.rst 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ViewportContainer.xml.
  6. .. _class_ViewportContainer:
  7. ViewportContainer
  8. =================
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Control for holding :ref:`Viewport<class_Viewport>`\ s.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A :ref:`Container<class_Container>` node that holds a :ref:`Viewport<class_Viewport>`, automatically setting the viewport's size.
  15. \ **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).
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------+------------------------------------------------------------------------+-----------+
  22. | :ref:`bool<class_bool>` | :ref:`stretch<class_ViewportContainer_property_stretch>` | ``false`` |
  23. +-------------------------+------------------------------------------------------------------------+-----------+
  24. | :ref:`int<class_int>` | :ref:`stretch_shrink<class_ViewportContainer_property_stretch_shrink>` | ``1`` |
  25. +-------------------------+------------------------------------------------------------------------+-----------+
  26. .. rst-class:: classref-section-separator
  27. ----
  28. .. rst-class:: classref-descriptions-group
  29. Property Descriptions
  30. ---------------------
  31. .. _class_ViewportContainer_property_stretch:
  32. .. rst-class:: classref-property
  33. :ref:`bool<class_bool>` **stretch** = ``false``
  34. .. rst-class:: classref-property-setget
  35. - void **set_stretch** **(** :ref:`bool<class_bool>` value **)**
  36. - :ref:`bool<class_bool>` **is_stretch_enabled** **(** **)**
  37. If ``true``, the viewport will be scaled to the control's size.
  38. .. rst-class:: classref-item-separator
  39. ----
  40. .. _class_ViewportContainer_property_stretch_shrink:
  41. .. rst-class:: classref-property
  42. :ref:`int<class_int>` **stretch_shrink** = ``1``
  43. .. rst-class:: classref-property-setget
  44. - void **set_stretch_shrink** **(** :ref:`int<class_int>` value **)**
  45. - :ref:`int<class_int>` **get_stretch_shrink** **(** **)**
  46. Divides the viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering.
  47. 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.
  48. \ **Note:** :ref:`stretch<class_ViewportContainer_property_stretch>` must be ``true`` for this property to work.
  49. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  50. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  51. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  52. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`