class_rid.rst 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/RID.xml.
  6. .. _class_RID:
  7. RID
  8. ===
  9. A handle for a :ref:`Resource<class_Resource>`'s unique identifier.
  10. .. rst-class:: classref-introduction-group
  11. Description
  12. -----------
  13. 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.
  14. 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>`.
  15. .. note::
  16. There are notable differences when using this API with C#. See :ref:`doc_c_sharp_differences` for more information.
  17. .. rst-class:: classref-reftable-group
  18. Constructors
  19. ------------
  20. .. table::
  21. :widths: auto
  22. +-----------------------+------------------------------------------------------------------------------+
  23. | :ref:`RID<class_RID>` | :ref:`RID<class_RID_constructor_RID>` **(** **)** |
  24. +-----------------------+------------------------------------------------------------------------------+
  25. | :ref:`RID<class_RID>` | :ref:`RID<class_RID_constructor_RID>` **(** :ref:`RID<class_RID>` from **)** |
  26. +-----------------------+------------------------------------------------------------------------------+
  27. .. rst-class:: classref-reftable-group
  28. Methods
  29. -------
  30. .. table::
  31. :widths: auto
  32. +-------------------------+----------------------------------------------------------------+
  33. | :ref:`int<class_int>` | :ref:`get_id<class_RID_method_get_id>` **(** **)** |const| |
  34. +-------------------------+----------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`is_valid<class_RID_method_is_valid>` **(** **)** |const| |
  36. +-------------------------+----------------------------------------------------------------+
  37. .. rst-class:: classref-reftable-group
  38. Operators
  39. ---------
  40. .. table::
  41. :widths: auto
  42. +-------------------------+-----------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`operator !=<class_RID_operator_neq_RID>` **(** :ref:`RID<class_RID>` right **)** |
  44. +-------------------------+-----------------------------------------------------------------------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`operator \<<class_RID_operator_lt_RID>` **(** :ref:`RID<class_RID>` right **)** |
  46. +-------------------------+-----------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`operator \<=<class_RID_operator_lte_RID>` **(** :ref:`RID<class_RID>` right **)** |
  48. +-------------------------+-----------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`operator ==<class_RID_operator_eq_RID>` **(** :ref:`RID<class_RID>` right **)** |
  50. +-------------------------+-----------------------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`operator ><class_RID_operator_gt_RID>` **(** :ref:`RID<class_RID>` right **)** |
  52. +-------------------------+-----------------------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`operator >=<class_RID_operator_gte_RID>` **(** :ref:`RID<class_RID>` right **)** |
  54. +-------------------------+-----------------------------------------------------------------------------------------+
  55. .. rst-class:: classref-section-separator
  56. ----
  57. .. rst-class:: classref-descriptions-group
  58. Constructor Descriptions
  59. ------------------------
  60. .. _class_RID_constructor_RID:
  61. .. rst-class:: classref-constructor
  62. :ref:`RID<class_RID>` **RID** **(** **)**
  63. Constructs an empty **RID** with the invalid ID ``0``.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. rst-class:: classref-constructor
  67. :ref:`RID<class_RID>` **RID** **(** :ref:`RID<class_RID>` from **)**
  68. Constructs a **RID** as a copy of the given **RID**.
  69. .. rst-class:: classref-section-separator
  70. ----
  71. .. rst-class:: classref-descriptions-group
  72. Method Descriptions
  73. -------------------
  74. .. _class_RID_method_get_id:
  75. .. rst-class:: classref-method
  76. :ref:`int<class_int>` **get_id** **(** **)** |const|
  77. Returns the ID of the referenced low-level resource.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_RID_method_is_valid:
  81. .. rst-class:: classref-method
  82. :ref:`bool<class_bool>` **is_valid** **(** **)** |const|
  83. Returns ``true`` if the **RID** is not ``0``.
  84. .. rst-class:: classref-section-separator
  85. ----
  86. .. rst-class:: classref-descriptions-group
  87. Operator Descriptions
  88. ---------------------
  89. .. _class_RID_operator_neq_RID:
  90. .. rst-class:: classref-operator
  91. :ref:`bool<class_bool>` **operator !=** **(** :ref:`RID<class_RID>` right **)**
  92. Returns ``true`` if the **RID**\ s are not equal.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_RID_operator_lt_RID:
  96. .. rst-class:: classref-operator
  97. :ref:`bool<class_bool>` **operator <** **(** :ref:`RID<class_RID>` right **)**
  98. Returns ``true`` if the **RID**'s ID is less than ``right``'s ID.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_RID_operator_lte_RID:
  102. .. rst-class:: classref-operator
  103. :ref:`bool<class_bool>` **operator <=** **(** :ref:`RID<class_RID>` right **)**
  104. Returns ``true`` if the **RID**'s ID is less than or equal to ``right``'s ID.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_RID_operator_eq_RID:
  108. .. rst-class:: classref-operator
  109. :ref:`bool<class_bool>` **operator ==** **(** :ref:`RID<class_RID>` right **)**
  110. Returns ``true`` if both **RID**\ s are equal, which means they both refer to the same low-level resource.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_RID_operator_gt_RID:
  114. .. rst-class:: classref-operator
  115. :ref:`bool<class_bool>` **operator >** **(** :ref:`RID<class_RID>` right **)**
  116. Returns ``true`` if the **RID**'s ID is greater than ``right``'s ID.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_RID_operator_gte_RID:
  120. .. rst-class:: classref-operator
  121. :ref:`bool<class_bool>` **operator >=** **(** :ref:`RID<class_RID>` right **)**
  122. Returns ``true`` if the **RID**'s ID is greater than or equal to ``right``'s ID.
  123. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  124. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  125. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  126. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  127. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  128. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  129. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`