class_subviewportcontainer.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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:`consume_drag_and_drop<class_SubViewportContainer_property_consume_drag_and_drop>` | ``false`` |
  24. +------------------------------------------+-----------------------------------------------------------------------------------------+---------------------------------------------------------------------+
  25. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``1`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  26. +------------------------------------------+-----------------------------------------------------------------------------------------+---------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`stretch<class_SubViewportContainer_property_stretch>` | ``false`` |
  28. +------------------------------------------+-----------------------------------------------------------------------------------------+---------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`stretch_shrink<class_SubViewportContainer_property_stretch_shrink>` | ``1`` |
  30. +------------------------------------------+-----------------------------------------------------------------------------------------+---------------------------------------------------------------------+
  31. .. rst-class:: classref-reftable-group
  32. Methods
  33. -------
  34. .. table::
  35. :widths: auto
  36. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`_propagate_input_event<class_SubViewportContainer_private_method__propagate_input_event>`\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| |const| |
  38. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. .. rst-class:: classref-section-separator
  40. ----
  41. .. rst-class:: classref-descriptions-group
  42. Property Descriptions
  43. ---------------------
  44. .. _class_SubViewportContainer_property_consume_drag_and_drop:
  45. .. rst-class:: classref-property
  46. :ref:`bool<class_bool>` **consume_drag_and_drop** = ``false`` :ref:`🔗<class_SubViewportContainer_property_consume_drag_and_drop>`
  47. .. rst-class:: classref-property-setget
  48. - |void| **set_consume_drag_and_drop**\ (\ value\: :ref:`bool<class_bool>`\ )
  49. - :ref:`bool<class_bool>` **is_consume_drag_and_drop_enabled**\ (\ )
  50. If ``false``, the **SubViewportContainer** is not available as a drop target in drag-and-drop operations, and instead the :ref:`Control<class_Control>` nodes inside its :ref:`Viewport<class_Viewport>` children are potential drop targets.
  51. If ``true``, the **SubViewportContainer** itself will be considered as a drop target in drag-and-drop operations, preventing the :ref:`Control<class_Control>` nodes inside its :ref:`Viewport<class_Viewport>` children from becoming drop targets.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_SubViewportContainer_property_stretch:
  55. .. rst-class:: classref-property
  56. :ref:`bool<class_bool>` **stretch** = ``false`` :ref:`🔗<class_SubViewportContainer_property_stretch>`
  57. .. rst-class:: classref-property-setget
  58. - |void| **set_stretch**\ (\ value\: :ref:`bool<class_bool>`\ )
  59. - :ref:`bool<class_bool>` **is_stretch_enabled**\ (\ )
  60. If ``true``, the sub-viewport will be automatically resized to the control's size.
  61. \ **Note:** If ``true``, this will prohibit changing :ref:`SubViewport.size<class_SubViewport_property_size>` of its children manually.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_SubViewportContainer_property_stretch_shrink:
  65. .. rst-class:: classref-property
  66. :ref:`int<class_int>` **stretch_shrink** = ``1`` :ref:`🔗<class_SubViewportContainer_property_stretch_shrink>`
  67. .. rst-class:: classref-property-setget
  68. - |void| **set_stretch_shrink**\ (\ value\: :ref:`int<class_int>`\ )
  69. - :ref:`int<class_int>` **get_stretch_shrink**\ (\ )
  70. Divides the sub-viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering.
  71. 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.
  72. \ **Note:** :ref:`stretch<class_SubViewportContainer_property_stretch>` must be ``true`` for this property to work.
  73. .. rst-class:: classref-section-separator
  74. ----
  75. .. rst-class:: classref-descriptions-group
  76. Method Descriptions
  77. -------------------
  78. .. _class_SubViewportContainer_private_method__propagate_input_event:
  79. .. rst-class:: classref-method
  80. :ref:`bool<class_bool>` **_propagate_input_event**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) |virtual| |const| :ref:`🔗<class_SubViewportContainer_private_method__propagate_input_event>`
  81. **Experimental:** This method may be changed or removed in future versions.
  82. Virtual method to be implemented by the user. If it returns ``true``, the ``event`` is propagated to :ref:`SubViewport<class_SubViewport>` children. Propagation doesn't happen if it returns ``false``. If the function is not implemented, all events are propagated to SubViewports.
  83. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  84. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  85. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  86. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  87. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  88. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  89. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  90. .. |void| replace:: :abbr:`void (No return value.)`