class_viewporttexture.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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/ViewportTexture.xml.
  6. .. _class_ViewportTexture:
  7. ViewportTexture
  8. ===============
  9. **Inherits:** :ref:`Texture2D<class_Texture2D>` **<** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Provides the content of a :ref:`Viewport<class_Viewport>` as a dynamic texture.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Provides the content of a :ref:`Viewport<class_Viewport>` as a dynamic :ref:`Texture2D<class_Texture2D>`. This can be used to mix controls, 2D game objects, and 3D game objects in the same scene.
  15. To create a **ViewportTexture** in code, use the :ref:`Viewport.get_texture<class_Viewport_method_get_texture>` method on the target viewport.
  16. \ **Note:** A **ViewportTexture** is always local to its scene (see :ref:`Resource.resource_local_to_scene<class_Resource_property_resource_local_to_scene>`). If the scene root is not ready, it may return incorrect data (see :ref:`Node.ready<class_Node_signal_ready>`).
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - `GUI in 3D Demo <https://godotengine.org/asset-library/asset/127>`__
  21. - `3D in 2D Demo <https://godotengine.org/asset-library/asset/128>`__
  22. - `2D in 3D Demo <https://godotengine.org/asset-library/asset/129>`__
  23. - `3D Viewport Scaling Demo <https://godotengine.org/asset-library/asset/586>`__
  24. .. rst-class:: classref-reftable-group
  25. Properties
  26. ----------
  27. .. table::
  28. :widths: auto
  29. +---------------------------------+--------------------------------------------------------------------+------------------+
  30. | :ref:`NodePath<class_NodePath>` | :ref:`viewport_path<class_ViewportTexture_property_viewport_path>` | ``NodePath("")`` |
  31. +---------------------------------+--------------------------------------------------------------------+------------------+
  32. .. rst-class:: classref-section-separator
  33. ----
  34. .. rst-class:: classref-descriptions-group
  35. Property Descriptions
  36. ---------------------
  37. .. _class_ViewportTexture_property_viewport_path:
  38. .. rst-class:: classref-property
  39. :ref:`NodePath<class_NodePath>` **viewport_path** = ``NodePath("")``
  40. .. rst-class:: classref-property-setget
  41. - void **set_viewport_path_in_scene** **(** :ref:`NodePath<class_NodePath>` value **)**
  42. - :ref:`NodePath<class_NodePath>` **get_viewport_path_in_scene** **(** **)**
  43. The path to the :ref:`Viewport<class_Viewport>` node to display. This is relative to the scene root, not to the node that uses the texture.
  44. \ **Note:** In the editor, this path is automatically updated when the target viewport or one of its ancestors is renamed or moved. At runtime, the path may not be able to automatically update due to the inability to determine the scene root.
  45. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  46. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  47. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  48. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  49. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  50. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  51. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`