Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
ClassDB¶
Inherits: Object
A class information repository.
Description¶
Provides access to metadata stored for every available class.
Methods¶
Method Descriptions¶
bool can_instantiate ( StringName class ) const
Returns true
if objects can be instantiated from the specified class
, otherwise returns false
.
bool class_exists ( StringName class ) const
Returns whether the specified class
is available or not.
PackedStringArray class_get_enum_constants ( StringName class, StringName enum, bool no_inheritance=false ) const
Returns an array with all the keys in enum
of class
or its ancestry.
PackedStringArray class_get_enum_list ( StringName class, bool no_inheritance=false ) const
Returns an array with all the enums of class
or its ancestry.
int class_get_integer_constant ( 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.
StringName class_get_integer_constant_enum ( StringName class, StringName name, bool no_inheritance=false ) const
Returns which enum the integer constant name
of class
or its ancestry belongs to.
PackedStringArray class_get_integer_constant_list ( StringName class, bool no_inheritance=false ) const
Returns an array with the names all the integer constants of class
or its ancestry.
Dictionary[] class_get_method_list ( StringName 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 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.
Variant class_get_property ( Object object, StringName property ) const
Returns the value of property
of object
or its ancestry.
Dictionary[] class_get_property_list ( StringName cl