class_rid.rst 7.2 KB

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