: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` 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` | :ref:`can_instantiate`\ (\ class\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`class_call_static`\ (\ class\: :ref:`StringName`, method\: :ref:`StringName`, ...\ ) |vararg| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_exists`\ (\ class\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`APIType` | :ref:`class_get_api_type`\ (\ class\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`class_get_enum_constants`\ (\ class\: :ref:`StringName`, enum\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`class_get_enum_list`\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`class_get_integer_constant`\ (\ class\: :ref:`StringName`, name\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StringName` | :ref:`class_get_integer_constant_enum`\ (\ class\: :ref:`StringName`, name\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`class_get_integer_constant_list`\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`class_get_method_argument_count`\ (\ class\: :ref:`StringName`, method\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Dictionary`\] | :ref:`class_get_method_list`\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`class_get_property`\ (\ object\: :ref:`Object`, property\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`class_get_property_default_value`\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StringName` | :ref:`class_get_property_getter`\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Dictionary`\] | :ref:`class_get_property_list`\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StringName` | :ref:`class_get_property_setter`\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`class_get_signal`\ (\ class\: :ref:`StringName`, signal\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Dictionary`\] | :ref:`class_get_signal_list`\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_has_enum`\ (\ class\: :ref:`StringName`, name\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_has_integer_constant`\ (\ class\: :ref:`StringName`, name\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_has_method`\ (\ class\: :ref:`StringName`, method\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`class_has_signal`\ (\ class\: :ref:`StringName`, signal\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`class_set_property`\ (\ object\: :ref:`Object`, property\: :ref:`StringName`, value\: :ref:`Variant`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`get_class_list`\ (\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`get_inheriters_from_class`\ (\ class\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StringName` | :ref:`get_parent_class`\ (\ class\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`instantiate`\ (\ class\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_class_enabled`\ (\ class\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_class_enum_bitfield`\ (\ class\: :ref:`StringName`, enum\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_parent_class`\ (\ class\: :ref:`StringName`, inherits\: :ref:`StringName`\ ) |const| | +------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_ClassDB_APIType: .. rst-class:: classref-enumeration enum **APIType**: :ref:`🔗` .. _class_ClassDB_constant_API_CORE: .. rst-class:: classref-enumeration-constant :ref:`APIType` **API_CORE** = ``0`` Native Core class type. .. _class_ClassDB_constant_API_EDITOR: .. rst-class:: classref-enumeration-constant :ref:`APIType` **API_EDITOR** = ``1`` Native Editor class type. .. _class_ClassDB_constant_API_EXTENSION: .. rst-class:: classref-enumeration-constant :ref:`APIType` **API_EXTENSION** = ``2`` GDExtension class type. .. _class_ClassDB_constant_API_EDITOR_EXTENSION: .. rst-class:: classref-enumeration-constant :ref:`APIType` **API_EDITOR_EXTENSION** = ``3`` GDExtension Editor class type. .. _class_ClassDB_constant_API_NONE: .. rst-class:: classref-enumeration-constant :ref:`APIType` **API_NONE** = ``4`` Unknown class type. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ClassDB_method_can_instantiate: .. rst-class:: classref-method :ref:`bool` **can_instantiate**\ (\ class\: :ref:`StringName`\ ) |const| :ref:`🔗` Returns ``true`` if objects can be instantiated from the specified ``class``, otherwise returns ``false``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_call_static: .. rst-class:: classref-method :ref:`Variant` **class_call_static**\ (\ class\: :ref:`StringName`, method\: :ref:`StringName`, ...\ ) |vararg| :ref:`🔗` Calls a static method on a class. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_exists: .. rst-class:: classref-method :ref:`bool` **class_exists**\ (\ class\: :ref:`StringName`\ ) |const| :ref:`🔗` Returns whether the specified ``class`` is available or not. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_api_type: .. rst-class:: classref-method :ref:`APIType` **class_get_api_type**\ (\ class\: :ref:`StringName`\ ) |const| :ref:`🔗` Returns the API type of the specified ``class``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_enum_constants: .. rst-class:: classref-method :ref:`PackedStringArray` **class_get_enum_constants**\ (\ class\: :ref:`StringName`, enum\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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_get_enum_list**\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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**\ (\ class\: :ref:`StringName`, name\: :ref:`StringName`\ ) |const| :ref:`🔗` 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_get_integer_constant_enum**\ (\ class\: :ref:`StringName`, name\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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_get_integer_constant_list**\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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_argument_count: .. rst-class:: classref-method :ref:`int` **class_get_method_argument_count**\ (\ class\: :ref:`StringName`, method\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` Returns the number of arguments of the method ``method`` of ``class`` or its ancestry if ``no_inheritance`` is ``false``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_method_list: .. rst-class:: classref-method :ref:`Array`\[:ref:`Dictionary`\] **class_get_method_list**\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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**\ (\ object\: :ref:`Object`, property\: :ref:`StringName`\ ) |const| :ref:`🔗` Returns the value of ``property`` of ``object`` or its ancestry. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_property_default_value: .. rst-class:: classref-method :ref:`Variant` **class_get_property_default_value**\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) |const| :ref:`🔗` Returns the default value of ``property`` of ``class`` or its ancestor classes. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_property_getter: .. rst-class:: classref-method :ref:`StringName` **class_get_property_getter**\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) :ref:`🔗` Returns the getter method name of ``property`` of ``class``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_property_list: .. rst-class:: classref-method :ref:`Array`\[:ref:`Dictionary`\] **class_get_property_list**\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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_property_setter: .. rst-class:: classref-method :ref:`StringName` **class_get_property_setter**\ (\ class\: :ref:`StringName`, property\: :ref:`StringName`\ ) :ref:`🔗` Returns the setter method name of ``property`` of ``class``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_class_get_signal: .. rst-class:: classref-method :ref:`Dictionary` **class_get_signal**\ (\ class\: :ref:`StringName`, signal\: :ref:`StringName`\ ) |const| :ref:`🔗` 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`\[:ref:`Dictionary`\] **class_get_signal_list**\ (\ class\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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**\ (\ class\: :ref:`StringName`, name\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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**\ (\ class\: :ref:`StringName`, name\: :ref:`StringName`\ ) |const| :ref:`🔗` 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**\ (\ class\: :ref:`StringName`, method\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` 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**\ (\ class\: :ref:`StringName`, signal\: :ref:`StringName`\ ) |const| :ref:`🔗` 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**\ (\ object\: :ref:`Object`, property\: :ref:`StringName`, value\: :ref:`Variant`\ ) |const| :ref:`🔗` Sets ``property`` value of ``object`` to ``value``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_get_class_list: .. rst-class:: classref-method :ref:`PackedStringArray` **get_class_list**\ (\ ) |const| :ref:`🔗` 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` **get_inheriters_from_class**\ (\ class\: :ref:`StringName`\ ) |const| :ref:`🔗` 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` **get_parent_class**\ (\ class\: :ref:`StringName`\ ) |const| :ref:`🔗` Returns the parent class of ``class``. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_instantiate: .. rst-class:: classref-method :ref:`Variant` **instantiate**\ (\ class\: :ref:`StringName`\ ) |const| :ref:`🔗` 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**\ (\ class\: :ref:`StringName`\ ) |const| :ref:`🔗` Returns whether this ``class`` is enabled or not. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_is_class_enum_bitfield: .. rst-class:: classref-method :ref:`bool` **is_class_enum_bitfield**\ (\ class\: :ref:`StringName`, enum\: :ref:`StringName`, no_inheritance\: :ref:`bool` = false\ ) |const| :ref:`🔗` Returns whether ``class`` (or its ancestor classes if ``no_inheritance`` is ``false``) has an enum called ``enum`` that is a bitfield. .. rst-class:: classref-item-separator ---- .. _class_ClassDB_method_is_parent_class: .. rst-class:: classref-method :ref:`bool` **is_parent_class**\ (\ class\: :ref:`StringName`, inherits\: :ref:`StringName`\ ) |const| :ref:`🔗` 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.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |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.)` .. |void| replace:: :abbr:`void (No return value.)`