class_subviewportcontainer.rst 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/SubViewportContainer.xml.
  6. .. _class_SubViewportContainer:
  7. SubViewportContainer
  8. ====================
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A container used for displaying the contents of a :ref:`SubViewport<class_SubViewport>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A container that displays the contents of underlying :ref:`SubViewport<class_SubViewport>` child nodes. It uses the combined size of the :ref:`SubViewport<class_SubViewport>`\ s as minimum size, unless :ref:`stretch<class_SubViewportContainer_property_stretch>` is enabled.
  15. \ **Note:** Changing a **SubViewportContainer**'s :ref:`Control.scale<class_Control_property_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. \ **Note:** The **SubViewportContainer** forwards mouse-enter and mouse-exit notifications to its sub-viewports.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-------------------------+---------------------------------------------------------------------------+-----------+
  23. | :ref:`bool<class_bool>` | :ref:`stretch<class_SubViewportContainer_property_stretch>` | ``false`` |
  24. +-------------------------+---------------------------------------------------------------------------+-----------+
  25. | :ref:`int<class_int>` | :ref:`stretch_shrink<class_SubViewportContainer_property_stretch_shrink>` | ``1`` |
  26. +-------------------------+---------------------------------------------------------------------------+-----------+
  27. .. rst-class:: classref-section-separator
  28. ----
  29. .. rst-class:: classref-descriptions-group
  30. Property Descriptions
  31. ---------------------
  32. .. _class_SubViewportContainer_property_stretch:
  33. .. rst-class:: classref-property
  34. :ref:`bool<class_bool>` **stretch** = ``false``
  35. .. rst-class:: classref-property-setget
  36. - void **set_stretch** **(** :ref:`bool<class_bool>` value **)**
  37. - :ref:`bool<class_bool>` **is_stretch_enabled** **(** **)**
  38. If ``true``, the sub-viewport will be automatically resized to the control's size.
  39. \ **Note:** If ``true``, this will prohibit changing :ref:`SubViewport.size<class_SubViewport_property_size>` of its children manually.
  40. .. rst-class:: classref-item-separator
  41. ----
  42. .. _class_SubViewportContainer_property_stretch_shrink:
  43. .. rst-class:: classref-property
  44. :ref:`int<class_int>` **stretch_shrink** = ``1``
  45. .. rst-class:: classref-property-setget
  46. - void **set_stretch_shrink** **(** :ref:`int<class_int>` value **)**
  47. - :ref:`int<class_int>` **get_stretch_shrink** **(** **)**
  48. Divides the sub-viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering.
  49. For example, a 1280×720 sub-viewport with :ref:`stretch_shrink<class_SubViewportContainer_property_stretch_shrink>` set to ``2`` will be rendered at 640×360 while occupying the same size in the container.
  50. \ **Note:** :ref:`stretch<class_SubViewportContainer_property_stretch>` must be ``true`` for this property to work.
  51. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  52. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  53. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  54. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  55. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  56. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`