class_viewporttexture.rst 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 ViewportTexture.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ViewportTexture:
  6. ViewportTexture
  7. ===============
  8. **Inherits:** :ref:`Texture2D<class_Texture2D>` **<** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Texture which displays the content of a :ref:`Viewport<class_Viewport>`.
  10. Description
  11. -----------
  12. Displays the content of a :ref:`Viewport<class_Viewport>` node as a dynamic :ref:`Texture2D<class_Texture2D>`. This can be used to mix controls, 2D, and 3D elements in the same scene.
  13. To create a ViewportTexture in code, use the :ref:`Viewport.get_texture<class_Viewport_method_get_texture>` method on the target viewport.
  14. Tutorials
  15. ---------
  16. - `GUI in 3D Demo <https://godotengine.org/asset-library/asset/127>`__
  17. - `3D in 2D Demo <https://godotengine.org/asset-library/asset/128>`__
  18. - `2D in 3D Demo <https://godotengine.org/asset-library/asset/129>`__
  19. - `3D Viewport Scaling Demo <https://godotengine.org/asset-library/asset/586>`__
  20. Properties
  21. ----------
  22. +---------------------------------+--------------------------------------------------------------------+---------------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
  24. +---------------------------------+--------------------------------------------------------------------+---------------------------------------------------------------------------------------+
  25. | :ref:`NodePath<class_NodePath>` | :ref:`viewport_path<class_ViewportTexture_property_viewport_path>` | ``NodePath("")`` |
  26. +---------------------------------+--------------------------------------------------------------------+---------------------------------------------------------------------------------------+
  27. Property Descriptions
  28. ---------------------
  29. .. _class_ViewportTexture_property_viewport_path:
  30. - :ref:`NodePath<class_NodePath>` **viewport_path**
  31. +-----------+-----------------------------------+
  32. | *Default* | ``NodePath("")`` |
  33. +-----------+-----------------------------------+
  34. | *Setter* | set_viewport_path_in_scene(value) |
  35. +-----------+-----------------------------------+
  36. | *Getter* | get_viewport_path_in_scene() |
  37. +-----------+-----------------------------------+
  38. The path to the :ref:`Viewport<class_Viewport>` node to display. This is relative to the scene root, not to the node which uses the texture.
  39. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  40. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  41. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  42. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  43. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  44. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`