:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ClassDB.xml. .. _class_ClassDB: ClassDB ======= **Inherits:** :ref:`Object` 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` | :ref:`can_instance` **(** :ref:`String` class **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_exists` **(** :ref:`String` class **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`class_get_category` **(** :ref:`String` class **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`class_get_enum_constants` **(** :ref:`String` class, :ref:`String` enum, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`class_get_enum_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`class_get_integer_constant` **(** :ref:`String` class, :ref:`String` name **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`class_get_integer_constant_enum` **(** :ref:`String` class, :ref:`String` name, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`class_get_integer_constant_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`class_get_method_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`class_get_property` **(** :ref:`Object` object, :ref:`String` property **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`class_get_property_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`class_get_signal` **(** :ref:`String` class, :ref:`String` signal **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`class_get_signal_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_has_enum` **(** :ref:`String` class, :ref:`String` name, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_has_integer_constant` **(** :ref:`String` class, :ref:`String` name **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_has_method` **(** :ref:`String` class, :ref:`String` method, :ref:`bool` no_inheritance=false **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_has_signal` **(** :ref:`String` class, :ref:`String` signal **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`class_set_property` **(** :ref:`Object` object, :ref:`String` property, :ref:`Variant` value **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_class_list` **(** **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_inheriters_from_class` **(** :ref:`String` class **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_parent_class` **(** :ref:`String` class **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`instance` **(** :ref:`String` class **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_class_enabled` **(** :ref:`String` class **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_parent_class` **(** :ref:`String` class, :ref:`String` inherits **)** |const| | +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ClassDB_method_can_instance: .. rst-class:: classref-method :ref:`bool` **can_instance** **(** :ref:`String` class **)** |const| Returns ``true`` if you can instance objects from the specified ``class``, ``false`` in other case. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_exists: .. rst-class:: classref-method :ref:`bool` **class_exists** **(** :ref:`String` class **)** |const| Returns whether the specified ``class`` is available or not. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_category: .. rst-class:: classref-method :ref:`String` **class_get_category** **(** :ref:`String` class **)** |const| Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_enum_constants: .. rst-class:: classref-method :ref:`PoolStringArray` **class_get_enum_constants** **(** :ref:`String` class, :ref:`String` enum, :ref:`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:`PoolStringArray` **class_get_enum_list** **(** :ref:`String` class, :ref:`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_get_integer_constant** **(** :ref:`String` class, :ref:`String` 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:`String` **class_get_integer_constant_enum** **(** :ref:`String` class, :ref:`String` name, :ref:`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:`PoolStringArray` **class_get_integer_constant_list** **(** :ref:`String` class, :ref:`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:`Array` **class_get_method_list** **(** :ref:`String` class, :ref:`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` 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_get_property** **(** :ref:`Object` object, :ref:`String` property **)** |const| Returns the value of ``property`` of ``class`` or its ancestry. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_property_list: .. rst-class:: classref-method :ref:`Array` **class_get_property_list** **(** :ref:`String` class, :ref:`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_get_signal** **(** :ref:`String` class, :ref:`String` signal **)** |const| Returns the ``signal`` data of ``class`` or its ancestry. The returned value is a :ref:`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:`Array` **class_get_signal_list** **(** :ref:`String` class, :ref:`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` as described in :ref:`class_get_signal`. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_has_enum: .. rst-class:: classref-method :ref:`bool` **class_has_enum** **(** :ref:`String` class, :ref:`String` name, :ref:`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_has_integer_constant** **(** :ref:`String` class, :ref:`String` 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_has_method** **(** :ref:`String` class, :ref:`String` method, :ref:`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_has_signal** **(** :ref:`String` class, :ref:`String` 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` **class_set_property** **(** :ref:`Object` object, :ref:`String` property, :ref:`Variant` value **)** |const| Sets ``property`` value of ``class`` to ``value``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_get_class_list: .. rst-class:: classref-method :ref:`PoolStringArray` **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:`PoolStringArray` **get_inheriters_from_class** **(** :ref:`String` 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:`String` **get_parent_class** **(** :ref:`String` class **)** |const| Returns the parent class of ``class``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_instance: .. rst-class:: classref-method :ref:`Variant` **instance** **(** :ref:`String` class **)** |const| Creates an instance of ``class``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_is_class_enabled: .. rst-class:: classref-method :ref:`bool` **is_class_enabled** **(** :ref:`String` 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` **is_parent_class** **(** :ref:`String` class, :ref:`String` 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.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`