class_object.rst 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Object.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Object:
  5. Object
  6. ======
  7. **Inherited By:** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>`, :ref:`ARVRServer<class_ARVRServer>`, :ref:`AudioServer<class_AudioServer>`, :ref:`CameraServer<class_CameraServer>`, :ref:`ClassDB<class_ClassDB>`, :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>`, :ref:`EditorNavigationMeshGenerator<class_EditorNavigationMeshGenerator>`, :ref:`EditorSelection<class_EditorSelection>`, :ref:`Engine<class_Engine>`, :ref:`Geometry<class_Geometry>`, :ref:`GodotSharp<class_GodotSharp>`, :ref:`IP<class_IP>`, :ref:`Input<class_Input>`, :ref:`InputMap<class_InputMap>`, :ref:`JSON<class_JSON>`, :ref:`JavaScript<class_JavaScript>`, :ref:`MainLoop<class_MainLoop>`, :ref:`Node<class_Node>`, :ref:`OS<class_OS>`, :ref:`Performance<class_Performance>`, :ref:`Physics2DDirectBodyState<class_Physics2DDirectBodyState>`, :ref:`Physics2DDirectSpaceState<class_Physics2DDirectSpaceState>`, :ref:`Physics2DServer<class_Physics2DServer>`, :ref:`PhysicsDirectBodyState<class_PhysicsDirectBodyState>`, :ref:`PhysicsDirectSpaceState<class_PhysicsDirectSpaceState>`, :ref:`PhysicsServer<class_PhysicsServer>`, :ref:`ProjectSettings<class_ProjectSettings>`, :ref:`Reference<class_Reference>`, :ref:`ResourceLoader<class_ResourceLoader>`, :ref:`ResourceSaver<class_ResourceSaver>`, :ref:`TranslationServer<class_TranslationServer>`, :ref:`TreeItem<class_TreeItem>`, :ref:`UndoRedo<class_UndoRedo>`, :ref:`VisualScriptEditor<class_VisualScriptEditor>`, :ref:`VisualServer<class_VisualServer>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Base class for all non built-in types.
  12. Methods
  13. -------
  14. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Variant<class_Variant>` | :ref:`_get<class_Object_method__get>` **(** :ref:`String<class_String>` property **)** virtual |
  16. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Array<class_Array>` | :ref:`_get_property_list<class_Object_method__get_property_list>` **(** **)** virtual |
  18. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`_init<class_Object_method__init>` **(** **)** virtual |
  20. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`_notification<class_Object_method__notification>` **(** :ref:`int<class_int>` what **)** virtual |
  22. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`_set<class_Object_method__set>` **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** virtual |
  24. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`String<class_String>` | :ref:`_to_string<class_Object_method__to_string>` **(** **)** virtual |
  26. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`add_user_signal<class_Object_method_add_user_signal>` **(** :ref:`String<class_String>` signal, :ref:`Array<class_Array>` arguments=[ ] **)** |
  28. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Variant<class_Variant>` | :ref:`call<class_Object_method_call>` **(** :ref:`String<class_String>` method, ... **)** vararg |
  30. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Variant<class_Variant>` | :ref:`call_deferred<class_Object_method_call_deferred>` **(** :ref:`String<class_String>` method, ... **)** vararg |
  32. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Variant<class_Variant>` | :ref:`callv<class_Object_method_callv>` **(** :ref:`String<class_String>` method, :ref:`Array<class_Array>` arg_array **)** |
  34. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`can_translate_messages<class_Object_method_can_translate_messages>` **(** **)** const |
  36. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect<class_Object_method_connect>` **(** :ref:`String<class_String>` signal, :ref:`Object<class_Object>` target, :ref:`String<class_String>` method, :ref:`Array<class_Array>` binds=[ ], :ref:`int<class_int>` flags=0 **)** |
  38. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`disconnect<class_Object_method_disconnect>` **(** :ref:`String<class_String>` signal, :ref:`Object<class_Object>` target, :ref:`String<class_String>` method **)** |
  40. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`Variant<class_Variant>` | :ref:`emit_signal<class_Object_method_emit_signal>` **(** :ref:`String<class_String>` signal, ... **)** vararg |
  42. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`free<class_Object_method_free>` **(** **)** |
  44. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Variant<class_Variant>` | :ref:`get<class_Object_method_get>` **(** :ref:`String<class_String>` property **)** const |
  46. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`String<class_String>` | :ref:`get_class<class_Object_method_get_class>` **(** **)** const |
  48. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`Array<class_Array>` | :ref:`get_incoming_connections<class_Object_method_get_incoming_connections>` **(** **)** const |
  50. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`Variant<class_Variant>` | :ref:`get_indexed<class_Object_method_get_indexed>` **(** :ref:`NodePath<class_NodePath>` property **)** const |
  52. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`get_instance_id<class_Object_method_get_instance_id>` **(** **)** const |
  54. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Variant<class_Variant>` | :ref:`get_meta<class_Object_method_get_meta>` **(** :ref:`String<class_String>` name **)** const |
  56. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_meta_list<class_Object_method_get_meta_list>` **(** **)** const |
  58. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Array<class_Array>` | :ref:`get_method_list<class_Object_method_get_method_list>` **(** **)** const |
  60. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`Array<class_Array>` | :ref:`get_property_list<class_Object_method_get_property_list>` **(** **)** const |
  62. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Reference<class_Reference>` | :ref:`get_script<class_Object_method_get_script>` **(** **)** const |
  64. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`Array<class_Array>` | :ref:`get_signal_connection_list<class_Object_method_get_signal_connection_list>` **(** :ref:`String<class_String>` signal **)** const |
  66. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Array<class_Array>` | :ref:`get_signal_list<class_Object_method_get_signal_list>` **(** **)** const |
  68. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`bool<class_bool>` | :ref:`has_meta<class_Object_method_has_meta>` **(** :ref:`String<class_String>` name **)** const |
  70. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`bool<class_bool>` | :ref:`has_method<class_Object_method_has_method>` **(** :ref:`String<class_String>` method **)** const |
  72. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`has_user_signal<class_Object_method_has_user_signal>` **(** :ref:`String<class_String>` signal **)** const |
  74. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`is_blocking_signals<class_Object_method_is_blocking_signals>` **(** **)** const |
  76. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`is_class<class_Object_method_is_class>` **(** :ref:`String<class_String>` type **)** const |
  78. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`bool<class_bool>` | :ref:`is_connected<class_Object_method_is_connected>` **(** :ref:`String<class_String>` signal, :ref:`Object<class_Object>` target, :ref:`String<class_String>` method **)** const |
  80. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`bool<class_bool>` | :ref:`is_queued_for_deletion<class_Object_method_is_queued_for_deletion>` **(** **)** const |
  82. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | void | :ref:`notification<class_Object_method_notification>` **(** :ref:`int<class_int>` what, :ref:`bool<class_bool>` reversed=false **)** |
  84. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`property_list_changed_notify<class_Object_method_property_list_changed_notify>` **(** **)** |
  86. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | void | :ref:`remove_meta<class_Object_method_remove_meta>` **(** :ref:`String<class_String>` name **)** |
  88. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`set<class_Object_method_set>` **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
  90. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`set_block_signals<class_Object_method_set_block_signals>` **(** :ref:`bool<class_bool>` enable **)** |
  92. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`set_deferred<class_Object_method_set_deferred>` **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** |
  94. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`set_indexed<class_Object_method_set_indexed>` **(** :ref:`NodePath<class_NodePath>` property, :ref:`Variant<class_Variant>` value **)** |
  96. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`set_message_translation<class_Object_method_set_message_translation>` **(** :ref:`bool<class_bool>` enable **)** |
  98. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`set_meta<class_Object_method_set_meta>` **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)** |
  100. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`set_script<class_Object_method_set_script>` **(** :ref:`Reference<class_Reference>` script **)** |
  102. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`String<class_String>` | :ref:`to_string<class_Object_method_to_string>` **(** **)** |
  104. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`String<class_String>` | :ref:`tr<class_Object_method_tr>` **(** :ref:`String<class_String>` message **)** const |
  106. +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. Signals
  108. -------
  109. .. _class_Object_signal_script_changed:
  110. - **script_changed** **(** **)**
  111. Emitted whenever the script of the Object is changed.
  112. Enumerations
  113. ------------
  114. .. _enum_Object_ConnectFlags:
  115. .. _class_Object_constant_CONNECT_DEFERRED:
  116. .. _class_Object_constant_CONNECT_PERSIST:
  117. .. _class_Object_constant_CONNECT_ONESHOT:
  118. .. _class_Object_constant_CONNECT_REFERENCE_COUNTED:
  119. enum **ConnectFlags**:
  120. - **CONNECT_DEFERRED** = **1** --- Connect a signal in deferred mode. This way, signal emissions are stored in a queue, then set on idle time.
  121. - **CONNECT_PERSIST** = **2** --- Persisting connections are saved when the object is serialized to file.
  122. - **CONNECT_ONESHOT** = **4** --- One shot connections disconnect themselves after emission.
  123. - **CONNECT_REFERENCE_COUNTED** = **8**
  124. Constants
  125. ---------
  126. .. _class_Object_constant_NOTIFICATION_POSTINITIALIZE:
  127. .. _class_Object_constant_NOTIFICATION_PREDELETE:
  128. - **NOTIFICATION_POSTINITIALIZE** = **0** --- Called right when the object is initialized. Not available in script.
  129. - **NOTIFICATION_PREDELETE** = **1** --- Called before the object is about to be deleted.
  130. Description
  131. -----------
  132. Every class which is not a built-in type inherits from this class.
  133. You can construct Objects from scripting languages, using ``Object.new()`` in GDScript, ``new Object`` in C#, or the "Construct Object" node in VisualScript.
  134. Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the :ref:`free<class_Object_method_free>` method from your script or delete the instance from C++.
  135. Some classes that extend Object add memory management. This is the case of :ref:`Reference<class_Reference>`, which counts references and deletes itself automatically when no longer referenced. :ref:`Node<class_Node>`, another fundamental type, deletes all its children when freed from memory.
  136. Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in :ref:`_get_property_list<class_Object_method__get_property_list>` and handled in :ref:`_get<class_Object_method__get>` and :ref:`_set<class_Object_method__set>`. However, scripting languages and C++ have simpler means to export them.
  137. Objects also receive notifications. Notifications are a simple way to notify the object about simple events, so they can all be handled together. See :ref:`_notification<class_Object_method__notification>`.
  138. Method Descriptions
  139. -------------------
  140. .. _class_Object_method__get:
  141. - :ref:`Variant<class_Variant>` **_get** **(** :ref:`String<class_String>` property **)** virtual
  142. Returns the given property. Returns ``null`` if the ``property`` does not exist.
  143. .. _class_Object_method__get_property_list:
  144. - :ref:`Array<class_Array>` **_get_property_list** **(** **)** virtual
  145. Returns the object's property list as an :ref:`Array<class_Array>` of dictionaries. Dictionaries must contain: name:String, type:int (see TYPE\_\* enum in :ref:`@GlobalScope<class_@GlobalScope>`) and optionally: hint:int (see PROPERTY_HINT\_\* in :ref:`@GlobalScope<class_@GlobalScope>`), hint_string:String, usage:int (see PROPERTY_USAGE\_\* in :ref:`@GlobalScope<class_@GlobalScope>`).
  146. .. _class_Object_method__init:
  147. - void **_init** **(** **)** virtual
  148. The virtual method called upon initialization.
  149. .. _class_Object_method__notification:
  150. - void **_notification** **(** :ref:`int<class_int>` what **)** virtual
  151. Notify the object internally using an ID.
  152. .. _class_Object_method__set:
  153. - :ref:`bool<class_bool>` **_set** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)** virtual
  154. Sets a property. Returns ``true`` if the ``property`` exists.
  155. .. _class_Object_method__to_string:
  156. - :ref:`String<class_String>` **_to_string** **(** **)** virtual
  157. Returns a :ref:`String<class_String>` representing the object. Default is ``"[ClassName:RID]"``.
  158. Override this method to customize the :ref:`String<class_String>` representation of the object when it's being converted to a string, for example: ``print(obj)``.
  159. .. _class_Object_method_add_user_signal:
  160. - void **add_user_signal** **(** :ref:`String<class_String>` signal, :ref:`Array<class_Array>` arguments=[ ] **)**
  161. Adds a user-defined ``signal``. Arguments are optional, but can be added as an :ref:`Array<class_Array>` of dictionaries, each containing "name" and "type" (from :ref:`@GlobalScope<class_@GlobalScope>` TYPE\_\*).
  162. .. _class_Object_method_call:
  163. - :ref:`Variant<class_Variant>` **call** **(** :ref:`String<class_String>` method, ... **)** vararg
  164. Calls the ``method`` on the object and returns a result. Pass parameters as a comma separated list.
  165. .. _class_Object_method_call_deferred:
  166. - :ref:`Variant<class_Variant>` **call_deferred** **(** :ref:`String<class_String>` method, ... **)** vararg
  167. Calls the ``method`` on the object during idle time and returns a result. Pass parameters as a comma separated list.
  168. .. _class_Object_method_callv:
  169. - :ref:`Variant<class_Variant>` **callv** **(** :ref:`String<class_String>` method, :ref:`Array<class_Array>` arg_array **)**
  170. Calls the ``method`` on the object and returns a result. Pass parameters as an :ref:`Array<class_Array>`.
  171. .. _class_Object_method_can_translate_messages:
  172. - :ref:`bool<class_bool>` **can_translate_messages** **(** **)** const
  173. Returns ``true`` if the object can translate strings.
  174. .. _class_Object_method_connect:
  175. - :ref:`Error<enum_@GlobalScope_Error>` **connect** **(** :ref:`String<class_String>` signal, :ref:`Object<class_Object>` target, :ref:`String<class_String>` method, :ref:`Array<class_Array>` binds=[ ], :ref:`int<class_int>` flags=0 **)**
  176. Connects a ``signal`` to a ``method`` on a ``target`` object. Pass optional ``binds`` to the call. Use ``flags`` to set deferred or one shot connections. See ``CONNECT_*`` constants.
  177. A ``signal`` can only be connected once to a ``method``. It will throw an error if already connected. To avoid this, first, use :ref:`is_connected<class_Object_method_is_connected>` to check for existing connections.
  178. If the ``target`` is destroyed in the game's lifecycle, the connection will be lost.
  179. .. _class_Object_method_disconnect:
  180. - void **disconnect** **(** :ref:`String<class_String>` signal, :ref:`Object<class_Object>` target, :ref:`String<class_String>` method **)**
  181. Disconnects a ``signal`` from a ``method`` on the given ``target``.
  182. If you try to disconnect a connection that does not exist, the method will throw an error. Use :ref:`is_connected<class_Object_method_is_connected>` to ensure that the connection exists.
  183. .. _class_Object_method_emit_signal:
  184. - :ref:`Variant<class_Variant>` **emit_signal** **(** :ref:`String<class_String>` signal, ... **)** vararg
  185. Emits the given ``signal``.
  186. .. _class_Object_method_free:
  187. - void **free** **(** **)**
  188. Deletes the object from memory.
  189. .. _class_Object_method_get:
  190. - :ref:`Variant<class_Variant>` **get** **(** :ref:`String<class_String>` property **)** const
  191. Returns a :ref:`Variant<class_Variant>` for a ``property``.
  192. .. _class_Object_method_get_class:
  193. - :ref:`String<class_String>` **get_class** **(** **)** const
  194. Returns the object's class as a :ref:`String<class_String>`.
  195. .. _class_Object_method_get_incoming_connections:
  196. - :ref:`Array<class_Array>` **get_incoming_connections** **(** **)** const
  197. Returns an :ref:`Array<class_Array>` of dictionaries with information about signals that are connected to the object.
  198. Inside each :ref:`Dictionary<class_Dictionary>` there are 3 fields:
  199. - "source" is a reference to signal emitter.
  200. - "signal_name" is name of connected signal.
  201. - "method_name" is a name of method to which signal is connected.
  202. .. _class_Object_method_get_indexed:
  203. - :ref:`Variant<class_Variant>` **get_indexed** **(** :ref:`NodePath<class_NodePath>` property **)** const
  204. Get indexed object property by String.
  205. Property indices get accessed with colon separation, for example: ``position:x``
  206. .. _class_Object_method_get_instance_id:
  207. - :ref:`int<class_int>` **get_instance_id** **(** **)** const
  208. Returns the object's unique instance ID.
  209. .. _class_Object_method_get_meta:
  210. - :ref:`Variant<class_Variant>` **get_meta** **(** :ref:`String<class_String>` name **)** const
  211. Returns the object's metadata for the given ``name``.
  212. .. _class_Object_method_get_meta_list:
  213. - :ref:`PoolStringArray<class_PoolStringArray>` **get_meta_list** **(** **)** const
  214. Returns the object's metadata as a :ref:`PoolStringArray<class_PoolStringArray>`.
  215. .. _class_Object_method_get_method_list:
  216. - :ref:`Array<class_Array>` **get_method_list** **(** **)** const
  217. Returns the object's methods and their signatures as an :ref:`Array<class_Array>`.
  218. .. _class_Object_method_get_property_list:
  219. - :ref:`Array<class_Array>` **get_property_list** **(** **)** const
  220. Returns the list of properties as an :ref:`Array<class_Array>` of dictionaries. Dictionaries contain: name:String, type:int (see TYPE\_\* enum in :ref:`@GlobalScope<class_@GlobalScope>`) and optionally: hint:int (see PROPERTY_HINT\_\* in :ref:`@GlobalScope<class_@GlobalScope>`), hint_string:String, usage:int (see PROPERTY_USAGE\_\* in :ref:`@GlobalScope<class_@GlobalScope>`).
  221. .. _class_Object_method_get_script:
  222. - :ref:`Reference<class_Reference>` **get_script** **(** **)** const
  223. Returns the object's :ref:`Script<class_Script>` or ``null`` if one doesn't exist.
  224. .. _class_Object_method_get_signal_connection_list:
  225. - :ref:`Array<class_Array>` **get_signal_connection_list** **(** :ref:`String<class_String>` signal **)** const
  226. Returns an :ref:`Array<class_Array>` of connections for the given ``signal``.
  227. .. _class_Object_method_get_signal_list:
  228. - :ref:`Array<class_Array>` **get_signal_list** **(** **)** const
  229. Returns the list of signals as an :ref:`Array<class_Array>` of dictionaries.
  230. .. _class_Object_method_has_meta:
  231. - :ref:`bool<class_bool>` **has_meta** **(** :ref:`String<class_String>` name **)** const
  232. Returns ``true`` if a metadata is found with the given ``name``.
  233. .. _class_Object_method_has_method:
  234. - :ref:`bool<class_bool>` **has_method** **(** :ref:`String<class_String>` method **)** const
  235. Returns ``true`` if the object contains the given ``method``.
  236. .. _class_Object_method_has_user_signal:
  237. - :ref:`bool<class_bool>` **has_user_signal** **(** :ref:`String<class_String>` signal **)** const
  238. Returns ``true`` if the given user-defined ``signal`` exists.
  239. .. _class_Object_method_is_blocking_signals:
  240. - :ref:`bool<class_bool>` **is_blocking_signals** **(** **)** const
  241. Returns ``true`` if signal emission blocking is enabled.
  242. .. _class_Object_method_is_class:
  243. - :ref:`bool<class_bool>` **is_class** **(** :ref:`String<class_String>` type **)** const
  244. Returns ``true`` if the object inherits from the given ``type``.
  245. .. _class_Object_method_is_connected:
  246. - :ref:`bool<class_bool>` **is_connected** **(** :ref:`String<class_String>` signal, :ref:`Object<class_Object>` target, :ref:`String<class_String>` method **)** const
  247. Returns ``true`` if a connection exists for a given ``signal``, ``target``, and ``method``.
  248. .. _class_Object_method_is_queued_for_deletion:
  249. - :ref:`bool<class_bool>` **is_queued_for_deletion** **(** **)** const
  250. Returns ``true`` if the ``queue_free`` method was called for the object.
  251. .. _class_Object_method_notification:
  252. - void **notification** **(** :ref:`int<class_int>` what, :ref:`bool<class_bool>` reversed=false **)**
  253. Notify the object of something.
  254. .. _class_Object_method_property_list_changed_notify:
  255. - void **property_list_changed_notify** **(** **)**
  256. .. _class_Object_method_remove_meta:
  257. - void **remove_meta** **(** :ref:`String<class_String>` name **)**
  258. .. _class_Object_method_set:
  259. - void **set** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
  260. Set property into the object.
  261. .. _class_Object_method_set_block_signals:
  262. - void **set_block_signals** **(** :ref:`bool<class_bool>` enable **)**
  263. If set to ``true``, signal emission is blocked.
  264. .. _class_Object_method_set_deferred:
  265. - void **set_deferred** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
  266. Set property into the object, after the current frame's physics step. This is equivalent to calling :ref:`set<class_Object_method_set>` via :ref:`call_deferred<class_Object_method_call_deferred>`, i.e. ``call_deferred("set", [property, value])``.
  267. .. _class_Object_method_set_indexed:
  268. - void **set_indexed** **(** :ref:`NodePath<class_NodePath>` property, :ref:`Variant<class_Variant>` value **)**
  269. .. _class_Object_method_set_message_translation:
  270. - void **set_message_translation** **(** :ref:`bool<class_bool>` enable **)**
  271. Define whether the object can translate strings (with calls to :ref:`tr<class_Object_method_tr>`). Default is ``true``.
  272. .. _class_Object_method_set_meta:
  273. - void **set_meta** **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)**
  274. Set a metadata into the object. Metadata is serialized. Metadata can be *anything*.
  275. .. _class_Object_method_set_script:
  276. - void **set_script** **(** :ref:`Reference<class_Reference>` script **)**
  277. Set a script into the object, scripts extend the object functionality.
  278. .. _class_Object_method_to_string:
  279. - :ref:`String<class_String>` **to_string** **(** **)**
  280. Returns a :ref:`String<class_String>` representing the object. Default is ``"[ClassName:RID]"``.
  281. Override the method :ref:`_to_string<class_Object_method__to_string>` to customize the :ref:`String<class_String>` representation.
  282. .. _class_Object_method_tr:
  283. - :ref:`String<class_String>` **tr** **(** :ref:`String<class_String>` message **)** const
  284. Translate a message. Only works if message translation is enabled (which it is by default). See :ref:`set_message_translation<class_Object_method_set_message_translation>`.