1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/ViewportTexture.xml.
- .. _class_ViewportTexture:
- ViewportTexture
- ===============
- **Inherits:** :ref:`Texture2D<class_Texture2D>` **<** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Provides the content of a :ref:`Viewport<class_Viewport>` as a dynamic texture.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- 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.
- To create a **ViewportTexture** in code, use the :ref:`Viewport.get_texture<class_Viewport_method_get_texture>` method on the target viewport.
- \ **Note:** When local to scene, this texture uses :ref:`Resource.setup_local_to_scene<class_Resource_method_setup_local_to_scene>` to set the proxy texture and flags in the local viewport. Local to scene **ViewportTexture**\ s will return incorrect data until the scene root is ready (see :ref:`Node.ready<class_Node_signal_ready>`).
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - `GUI in 3D Demo <https://godotengine.org/asset-library/asset/127>`__
- - `3D in 2D Demo <https://godotengine.org/asset-library/asset/128>`__
- - `2D in 3D Demo <https://godotengine.org/asset-library/asset/129>`__
- - `3D Viewport Scaling Demo <https://godotengine.org/asset-library/asset/586>`__
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +---------------------------------+--------------------------------------------------------------------+------------------+
- | :ref:`NodePath<class_NodePath>` | :ref:`viewport_path<class_ViewportTexture_property_viewport_path>` | ``NodePath("")`` |
- +---------------------------------+--------------------------------------------------------------------+------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_ViewportTexture_property_viewport_path:
- .. rst-class:: classref-property
- :ref:`NodePath<class_NodePath>` **viewport_path** = ``NodePath("")``
- .. rst-class:: classref-property-setget
- - void **set_viewport_path_in_scene** **(** :ref:`NodePath<class_NodePath>` value **)**
- - :ref:`NodePath<class_NodePath>` **get_viewport_path_in_scene** **(** **)**
- 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.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|