mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
218 lines
7.4 KiB
ReStructuredText
218 lines
7.4 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/RID.xml.
|
|
|
|
.. _class_RID:
|
|
|
|
RID
|
|
===
|
|
|
|
A handle for a :ref:`Resource<class_Resource>`'s unique identifier.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Description
|
|
-----------
|
|
|
|
The RID :ref:`Variant<class_Variant>` type is used to access a low-level resource by its unique ID. RIDs are opaque, which means they do not grant access to the resource by themselves. They are used by the low-level server classes, such as :ref:`DisplayServer<class_DisplayServer>`, :ref:`RenderingServer<class_RenderingServer>`, :ref:`TextServer<class_TextServer>`, etc.
|
|
|
|
A low-level resource may correspond to a high-level :ref:`Resource<class_Resource>`, such as :ref:`Texture<class_Texture>` or :ref:`Mesh<class_Mesh>`.
|
|
|
|
.. note::
|
|
|
|
There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Constructors
|
|
------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------+------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_RID>` | :ref:`RID<class_RID_constructor_RID>` **(** **)** |
|
|
+-----------------------+------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_RID>` | :ref:`RID<class_RID_constructor_RID>` **(** :ref:`RID<class_RID>` from **)** |
|
|
+-----------------------+------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Methods
|
|
-------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------+----------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_id<class_RID_method_get_id>` **(** **)** |const| |
|
|
+-------------------------+----------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_valid<class_RID_method_is_valid>` **(** **)** |const| |
|
|
+-------------------------+----------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Operators
|
|
---------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------+-----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`operator !=<class_RID_operator_neq_RID>` **(** :ref:`RID<class_RID>` right **)** |
|
|
+-------------------------+-----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`operator \<<class_RID_operator_lt_RID>` **(** :ref:`RID<class_RID>` right **)** |
|
|
+-------------------------+-----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`operator \<=<class_RID_operator_lte_RID>` **(** :ref:`RID<class_RID>` right **)** |
|
|
+-------------------------+-----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`operator ==<class_RID_operator_eq_RID>` **(** :ref:`RID<class_RID>` right **)** |
|
|
+-------------------------+-----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`operator ><class_RID_operator_gt_RID>` **(** :ref:`RID<class_RID>` right **)** |
|
|
+-------------------------+-----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`operator >=<class_RID_operator_gte_RID>` **(** :ref:`RID<class_RID>` right **)** |
|
|
+-------------------------+-----------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Constructor Descriptions
|
|
------------------------
|
|
|
|
.. _class_RID_constructor_RID:
|
|
|
|
.. rst-class:: classref-constructor
|
|
|
|
:ref:`RID<class_RID>` **RID** **(** **)**
|
|
|
|
Constructs an empty **RID** with the invalid ID ``0``.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-constructor
|
|
|
|
:ref:`RID<class_RID>` **RID** **(** :ref:`RID<class_RID>` from **)**
|
|
|
|
Constructs a **RID** as a copy of the given **RID**.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_RID_method_get_id:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **get_id** **(** **)** |const|
|
|
|
|
Returns the ID of the referenced low-level resource.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_RID_method_is_valid:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **is_valid** **(** **)** |const|
|
|
|
|
Returns ``true`` if the **RID** is not ``0``.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Operator Descriptions
|
|
---------------------
|
|
|
|
.. _class_RID_operator_neq_RID:
|
|
|
|
.. rst-class:: classref-operator
|
|
|
|
:ref:`bool<class_bool>` **operator !=** **(** :ref:`RID<class_RID>` right **)**
|
|
|
|
Returns ``true`` if the **RID**\ s are not equal.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_RID_operator_lt_RID:
|
|
|
|
.. rst-class:: classref-operator
|
|
|
|
:ref:`bool<class_bool>` **operator <** **(** :ref:`RID<class_RID>` right **)**
|
|
|
|
Returns ``true`` if the **RID**'s ID is less than ``right``'s ID.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_RID_operator_lte_RID:
|
|
|
|
.. rst-class:: classref-operator
|
|
|
|
:ref:`bool<class_bool>` **operator <=** **(** :ref:`RID<class_RID>` right **)**
|
|
|
|
Returns ``true`` if the **RID**'s ID is less than or equal to ``right``'s ID.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_RID_operator_eq_RID:
|
|
|
|
.. rst-class:: classref-operator
|
|
|
|
:ref:`bool<class_bool>` **operator ==** **(** :ref:`RID<class_RID>` right **)**
|
|
|
|
Returns ``true`` if both **RID**\ s are equal, which means they both refer to the same low-level resource.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_RID_operator_gt_RID:
|
|
|
|
.. rst-class:: classref-operator
|
|
|
|
:ref:`bool<class_bool>` **operator >** **(** :ref:`RID<class_RID>` right **)**
|
|
|
|
Returns ``true`` if the **RID**'s ID is greater than ``right``'s ID.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_RID_operator_gte_RID:
|
|
|
|
.. rst-class:: classref-operator
|
|
|
|
:ref:`bool<class_bool>` **operator >=** **(** :ref:`RID<class_RID>` right **)**
|
|
|
|
Returns ``true`` if the **RID**'s ID is greater than or equal to ``right``'s ID.
|
|
|
|
.. |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.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|