class_subviewportcontainer.rst 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the SubViewportContainer.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_SubViewportContainer:
  6. SubViewportContainer
  7. ====================
  8. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Control for holding :ref:`SubViewport<class_SubViewport>`\ s.
  10. Description
  11. -----------
  12. A :ref:`Container<class_Container>` node that holds a :ref:`SubViewport<class_SubViewport>`. It uses the :ref:`SubViewport<class_SubViewport>`'s size as minimum size, unless :ref:`stretch<class_SubViewportContainer_property_stretch>` is enabled.
  13. \ **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).
  14. \ **Note:** The SubViewportContainer forwards mouse-enter and mouse-exit notifications to its sub-viewports.
  15. Properties
  16. ----------
  17. +-------------------------+---------------------------------------------------------------------------+-----------+
  18. | :ref:`bool<class_bool>` | :ref:`stretch<class_SubViewportContainer_property_stretch>` | ``false`` |
  19. +-------------------------+---------------------------------------------------------------------------+-----------+
  20. | :ref:`int<class_int>` | :ref:`stretch_shrink<class_SubViewportContainer_property_stretch_shrink>` | ``1`` |
  21. +-------------------------+---------------------------------------------------------------------------+-----------+
  22. Property Descriptions
  23. ---------------------
  24. .. _class_SubViewportContainer_property_stretch:
  25. - :ref:`bool<class_bool>` **stretch**
  26. +-----------+----------------------+
  27. | *Default* | ``false`` |
  28. +-----------+----------------------+
  29. | *Setter* | set_stretch(value) |
  30. +-----------+----------------------+
  31. | *Getter* | is_stretch_enabled() |
  32. +-----------+----------------------+
  33. If ``true``, the sub-viewport will be automatically resized to the control's size.
  34. ----
  35. .. _class_SubViewportContainer_property_stretch_shrink:
  36. - :ref:`int<class_int>` **stretch_shrink**
  37. +-----------+---------------------------+
  38. | *Default* | ``1`` |
  39. +-----------+---------------------------+
  40. | *Setter* | set_stretch_shrink(value) |
  41. +-----------+---------------------------+
  42. | *Getter* | get_stretch_shrink() |
  43. +-----------+---------------------------+
  44. Divides the sub-viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering.
  45. 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.
  46. \ **Note:** :ref:`stretch<class_SubViewportContainer_property_stretch>` must be ``true`` for this property to work.
  47. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  48. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  49. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  50. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  51. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  52. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`