123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ClassDB.xml.
- .. _class_ClassDB:
- ClassDB
- =======
- **Inherits:** :ref:`Object<class_Object>`
- A class information repository.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- Provides access to metadata stored for every available class.
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`can_instantiate<class_ClassDB_method_can_instantiate>` **(** :ref:`StringName<class_StringName>` class **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`class_exists<class_ClassDB_method_class_exists>` **(** :ref:`StringName<class_StringName>` class **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`class_get_enum_constants<class_ClassDB_method_class_get_enum_constants>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` enum, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`class_get_enum_list<class_ClassDB_method_class_get_enum_list>` **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`class_get_integer_constant<class_ClassDB_method_class_get_integer_constant>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` name **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StringName<class_StringName>` | :ref:`class_get_integer_constant_enum<class_ClassDB_method_class_get_integer_constant_enum>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` name, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`class_get_integer_constant_list<class_ClassDB_method_class_get_integer_constant_list>` **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Dictionary[]<class_Dictionary>` | :ref:`class_get_method_list<class_ClassDB_method_class_get_method_list>` **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`class_get_property<class_ClassDB_method_class_get_property>` **(** :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` property **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Dictionary[]<class_Dictionary>` | :ref:`class_get_property_list<class_ClassDB_method_class_get_property_list>` **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Dictionary<class_Dictionary>` | :ref:`class_get_signal<class_ClassDB_method_class_get_signal>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` signal **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Dictionary[]<class_Dictionary>` | :ref:`class_get_signal_list<class_ClassDB_method_class_get_signal_list>` **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`class_has_enum<class_ClassDB_method_class_has_enum>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` name, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`class_has_integer_constant<class_ClassDB_method_class_has_integer_constant>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` name **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`class_has_method<class_ClassDB_method_class_has_method>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` method, :ref:`bool<class_bool>` no_inheritance=false **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`class_has_signal<class_ClassDB_method_class_has_signal>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` signal **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`class_set_property<class_ClassDB_method_class_set_property>` **(** :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` property, :ref:`Variant<class_Variant>` value **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_class_list<class_ClassDB_method_get_class_list>` **(** **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_inheriters_from_class<class_ClassDB_method_get_inheriters_from_class>` **(** :ref:`StringName<class_StringName>` class **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StringName<class_StringName>` | :ref:`get_parent_class<class_ClassDB_method_get_parent_class>` **(** :ref:`StringName<class_StringName>` class **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`instantiate<class_ClassDB_method_instantiate>` **(** :ref:`StringName<class_StringName>` class **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_class_enabled<class_ClassDB_method_is_class_enabled>` **(** :ref:`StringName<class_StringName>` class **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_parent_class<class_ClassDB_method_is_parent_class>` **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` inherits **)** |const| |
- +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_ClassDB_method_can_instantiate:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **can_instantiate** **(** :ref:`StringName<class_StringName>` class **)** |const|
- Returns ``true`` if objects can be instantiated from the specified ``class``, otherwise returns ``false``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_exists:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **class_exists** **(** :ref:`StringName<class_StringName>` class **)** |const|
- Returns whether the specified ``class`` is available or not.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_enum_constants:
- .. rst-class:: classref-method
- :ref:`PackedStringArray<class_PackedStringArray>` **class_get_enum_constants** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` enum, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns an array with all the keys in ``enum`` of ``class`` or its ancestry.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_enum_list:
- .. rst-class:: classref-method
- :ref:`PackedStringArray<class_PackedStringArray>` **class_get_enum_list** **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns an array with all the enums of ``class`` or its ancestry.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_integer_constant:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **class_get_integer_constant** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` name **)** |const|
- Returns the value of the integer constant ``name`` of ``class`` or its ancestry. Always returns 0 when the constant could not be found.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_integer_constant_enum:
- .. rst-class:: classref-method
- :ref:`StringName<class_StringName>` **class_get_integer_constant_enum** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` name, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns which enum the integer constant ``name`` of ``class`` or its ancestry belongs to.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_integer_constant_list:
- .. rst-class:: classref-method
- :ref:`PackedStringArray<class_PackedStringArray>` **class_get_integer_constant_list** **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns an array with the names all the integer constants of ``class`` or its ancestry.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_method_list:
- .. rst-class:: classref-method
- :ref:`Dictionary[]<class_Dictionary>` **class_get_method_list** **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns an array with all the methods of ``class`` or its ancestry if ``no_inheritance`` is ``false``. Every element of the array is a :ref:`Dictionary<class_Dictionary>` with the following keys: ``args``, ``default_args``, ``flags``, ``id``, ``name``, ``return: (class_name, hint, hint_string, name, type, usage)``.
- \ **Note:** In exported release builds the debug info is not available, so the returned dictionaries will contain only method names.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_property:
- .. rst-class:: classref-method
- :ref:`Variant<class_Variant>` **class_get_property** **(** :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` property **)** |const|
- Returns the value of ``property`` of ``object`` or its ancestry.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_property_list:
- .. rst-class:: classref-method
- :ref:`Dictionary[]<class_Dictionary>` **class_get_property_list** **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns an array with all the properties of ``class`` or its ancestry if ``no_inheritance`` is ``false``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_signal:
- .. rst-class:: classref-method
- :ref:`Dictionary<class_Dictionary>` **class_get_signal** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` signal **)** |const|
- Returns the ``signal`` data of ``class`` or its ancestry. The returned value is a :ref:`Dictionary<class_Dictionary>` with the following keys: ``args``, ``default_args``, ``flags``, ``id``, ``name``, ``return: (class_name, hint, hint_string, name, type, usage)``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_get_signal_list:
- .. rst-class:: classref-method
- :ref:`Dictionary[]<class_Dictionary>` **class_get_signal_list** **(** :ref:`StringName<class_StringName>` class, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns an array with all the signals of ``class`` or its ancestry if ``no_inheritance`` is ``false``. Every element of the array is a :ref:`Dictionary<class_Dictionary>` as described in :ref:`class_get_signal<class_ClassDB_method_class_get_signal>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_has_enum:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **class_has_enum** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` name, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns whether ``class`` or its ancestry has an enum called ``name`` or not.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_has_integer_constant:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **class_has_integer_constant** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` name **)** |const|
- Returns whether ``class`` or its ancestry has an integer constant called ``name`` or not.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_has_method:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **class_has_method** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` method, :ref:`bool<class_bool>` no_inheritance=false **)** |const|
- Returns whether ``class`` (or its ancestry if ``no_inheritance`` is ``false``) has a method called ``method`` or not.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_has_signal:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **class_has_signal** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` signal **)** |const|
- Returns whether ``class`` or its ancestry has a signal called ``signal`` or not.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_class_set_property:
- .. rst-class:: classref-method
- :ref:`Error<enum_@GlobalScope_Error>` **class_set_property** **(** :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` property, :ref:`Variant<class_Variant>` value **)** |const|
- Sets ``property`` value of ``object`` to ``value``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_get_class_list:
- .. rst-class:: classref-method
- :ref:`PackedStringArray<class_PackedStringArray>` **get_class_list** **(** **)** |const|
- Returns the names of all the classes available.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_get_inheriters_from_class:
- .. rst-class:: classref-method
- :ref:`PackedStringArray<class_PackedStringArray>` **get_inheriters_from_class** **(** :ref:`StringName<class_StringName>` class **)** |const|
- Returns the names of all the classes that directly or indirectly inherit from ``class``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_get_parent_class:
- .. rst-class:: classref-method
- :ref:`StringName<class_StringName>` **get_parent_class** **(** :ref:`StringName<class_StringName>` class **)** |const|
- Returns the parent class of ``class``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_instantiate:
- .. rst-class:: classref-method
- :ref:`Variant<class_Variant>` **instantiate** **(** :ref:`StringName<class_StringName>` class **)** |const|
- Creates an instance of ``class``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_is_class_enabled:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_class_enabled** **(** :ref:`StringName<class_StringName>` class **)** |const|
- Returns whether this ``class`` is enabled or not.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ClassDB_method_is_parent_class:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_parent_class** **(** :ref:`StringName<class_StringName>` class, :ref:`StringName<class_StringName>` inherits **)** |const|
- Returns whether ``inherits`` is an ancestor of ``class`` or not.
- .. |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.)`
|