Class ClassDB
A class information repository.
- Inheritance
-
ClassDB
Remarks
Provides access to metadata stored for every available class.
Methods
can_instantiate(StringName)
Qualifiers: const
Returns true if objects can be instantiated from the specified class, otherwise returns false.
bool can_instantiate(StringName class)
Parameters
classStringName
class_call_static(StringName, StringName, ...)
Qualifiers: vararg
Calls a static method on a class.
Variant class_call_static(StringName class, StringName method, ...)
Parameters
classStringNamemethodStringName
class_exists(StringName)
Qualifiers: const
Returns whether the specified class is available or not.
bool class_exists(StringName class)
Parameters
classStringName
class_get_api_type(StringName)
Qualifiers: const
Returns the API type of class. See APIType.
int class_get_api_type(StringName class)
Parameters
classStringName
class_get_enum_constants(StringName, StringName, bool)
Qualifiers: const
Returns an array with all the keys in enum of class or its ancestry.
PackedStringArray class_get_enum_constants(StringName class, StringName enum, bool no_inheritance)
Parameters
classStringNameenumStringNameno_inheritancebool
class_get_enum_list(StringName, bool)
Qualifiers: const
Returns an array with all the enums of class or its ancestry.
PackedStringArray class_get_enum_list(StringName class, bool no_inheritance)
Parameters
classStringNameno_inheritancebool
class_get_integer_constant(StringName, StringName)
Qualifiers: const
Returns the value of the integer constant name of class or its ancestry. Always returns 0 when the constant could not be found.
int class_get_integer_constant(StringName class, StringName name)
Parameters
classStringNamenameStringName
class_get_integer_constant_enum(StringName, StringName, bool)
Qualifiers: const
Returns which enum the integer constant name of class or its ancestry belongs to.
StringName class_get_integer_constant_enum(StringName class, StringName name, bool no_inheritance)
Parameters
classStringNamenameStringNameno_inheritancebool
class_get_integer_constant_list(StringName, bool)
Qualifiers: const
Returns an array with the names all the integer constants of class or its ancestry.
PackedStringArray class_get_integer_constant_list(StringName class, bool no_inheritance)
Parameters
classStringNameno_inheritancebool
class_get_method_argument_count(StringName, StringName, bool)
Qualifiers: const
Returns the number of arguments of the method method of class or its ancestry if no_inheritance is false.
int class_get_method_argument_count(StringName class, StringName method, bool no_inheritance)
Parameters
classStringNamemethodStringNameno_inheritancebool
class_get_method_list(StringName, bool)
Qualifiers: 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 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.
Dictionary[] class_get_method_list(StringName class, bool no_inheritance)
Parameters
classStringNameno_inheritancebool
class_get_property(Object, StringName)
Qualifiers: const
Returns the value of property of object or its ancestry.
Variant class_get_property(Object object, StringName property)
Parameters
objectObjectpropertyStringName
class_get_property_default_value(StringName, StringName)
Qualifiers: const
Returns the default value of property of class or its ancestor classes.
Variant class_get_property_default_value(StringName class, StringName property)
Parameters
classStringNamepropertyStringName
class_get_property_getter(StringName, StringName)
Returns the getter method name of property of class.
StringName class_get_property_getter(StringName class, StringName property)
Parameters
classStringNamepropertyStringName
class_get_property_list(StringName, bool)
Qualifiers: const
Returns an array with all the properties of class or its ancestry if no_inheritance is false.
Dictionary[] class_get_property_list(StringName class, bool no_inheritance)
Parameters
classStringNameno_inheritancebool
class_get_property_setter(StringName, StringName)
Returns the setter method name of property of class.
StringName class_get_property_setter(StringName class, StringName property)
Parameters
classStringNamepropertyStringName
class_get_signal(StringName, StringName)
Qualifiers: const
Returns the signal data of class or its ancestry. The returned value is a Dictionary with the following keys: args, default_args, flags, id, name, return: (class_name, hint, hint_string, name, type, usage).
Dictionary class_get_signal(StringName class, StringName signal)
Parameters
classStringNamesignalStringName
class_get_signal_list(StringName, bool)
Qualifiers: 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 Dictionary as described in ClassDB.class_get_signal.
Dictionary[] class_get_signal_list(StringName class, bool no_inheritance)
Parameters
classStringNameno_inheritancebool
class_has_enum(StringName, StringName, bool)
Qualifiers: const
Returns whether class or its ancestry has an enum called name or not.
bool class_has_enum(StringName class, StringName name, bool no_inheritance)
Parameters
classStringNamenameStringNameno_inheritancebool
class_has_integer_constant(StringName, StringName)
Qualifiers: const
Returns whether class or its ancestry has an integer constant called name or not.
bool class_has_integer_constant(StringName class, StringName name)
Parameters
classStringNamenameStringName
class_has_method(StringName, StringName, bool)
Qualifiers: const
Returns whether class (or its ancestry if no_inheritance is false) has a method called method or not.
bool class_has_method(StringName class, StringName method, bool no_inheritance)
Parameters
classStringNamemethodStringNameno_inheritancebool
class_has_signal(StringName, StringName)
Qualifiers: const
Returns whether class or its ancestry has a signal called signal or not.
bool class_has_signal(StringName class, StringName signal)
Parameters
classStringNamesignalStringName
class_set_property(Object, StringName, Variant)
Qualifiers: const
Sets property value of object to value.
int class_set_property(Object object, StringName property, Variant value)
Parameters
objectObjectpropertyStringNamevalueVariant
get_class_list
Qualifiers: const
Returns the names of all the classes available.
PackedStringArray get_class_list
get_inheriters_from_class(StringName)
Qualifiers: const
Returns the names of all the classes that directly or indirectly inherit from class.
PackedStringArray get_inheriters_from_class(StringName class)
Parameters
classStringName
get_parent_class(StringName)
Qualifiers: const
Returns the parent class of class.
StringName get_parent_class(StringName class)
Parameters
classStringName
instantiate(StringName)
Qualifiers: const
Creates an instance of class.
Variant instantiate(StringName class)
Parameters
classStringName
is_class_enabled(StringName)
Qualifiers: const
Returns whether this class is enabled or not.
bool is_class_enabled(StringName class)
Parameters
classStringName
is_class_enum_bitfield(StringName, StringName, bool)
Qualifiers: const
Returns whether class (or its ancestor classes if no_inheritance is false) has an enum called enum that is a bitfield.
bool is_class_enum_bitfield(StringName class, StringName enum, bool no_inheritance)
Parameters
classStringNameenumStringNameno_inheritancebool
is_parent_class(StringName, StringName)
Qualifiers: const
Returns whether inherits is an ancestor of class or not.
bool is_parent_class(StringName class, StringName inherits)
Parameters
classStringNameinheritsStringName