ClassDB

Inherits: Object

Class information repository.

Description

Provides access to metadata stored for every available class.

Methods

bool

can_instance ( String class ) const

bool

class_exists ( String class ) const

String

class_get_category ( String class ) const

int

class_get_integer_constant ( String class, String name ) const

PoolStringArray

class_get_integer_constant_list ( String class, bool no_inheritance=false ) const

Array

class_get_method_list ( String class, bool no_inheritance=false ) const

Variant

class_get_property ( Object object, String property ) const

Array

class_get_property_list ( String class, bool no_inheritance=false ) const

Dictionary

class_get_signal ( String class, String signal ) const

Array

class_get_signal_list ( String class, bool no_inheritance=false ) const

bool

class_has_integer_constant ( String class, String name ) const

bool

class_has_method ( String class, String method, bool no_inheritance=false ) const

bool

class_has_signal ( String class, String signal ) const

Error

class_set_property ( Object object, String property, Variant value ) const

PoolStringArray

get_class_list ( ) const

PoolStringArray

get_inheriters_from_class ( String class ) const

String

get_parent_class ( String class ) const

Variant

instance ( String class ) const

bool

is_class_enabled ( String class ) const

bool

is_parent_class ( String class, String inherits ) const

Method Descriptions

bool can_instance ( String class ) const

Returns true if you can instance objects from the specified class, false in other case.

bool class_exists ( String class ) const

Returns whether the specified class is available or not.

String class_get_category ( String class ) const

Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required.

int class_get_integer_constant ( String class, 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.

PoolStringArray class_get_integer_constant_list ( String class, bool no_inheritance=false ) const

Returns an array with the names all the integer constants of class or its ancestry.

Array class_get_method_list ( String 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, String property ) const

Returns the value of property of class or its ancestry.

Array class_get_property_list ( String class, bool no_inheritance=false ) const

Returns an array with all the properties of class or its ancestry if no_inheritance is false.

Dictionary class_get_signal ( String class, String signal ) 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).

Array class_get_signal_list ( String 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 Dictionary as described in class_get_signal.

bool class_has_integer_constant ( String class, String name ) const

Returns whether class or its ancestry has an integer constant called name or not.

bool class_has_method ( String class, String method, bool no_inheritance=false ) const

Returns whether class (or its ancestry if no_inheritance is false) has a method called method or not.

bool class_has_signal ( String class, String signal ) const

Returns whether class or its ancestry has a signal called signal or not.

Error class_set_property ( Object object, String property, Variant value ) const

Sets property value of class to value.

PoolStringArray get_class_list ( ) const

Returns the names of all the classes available.

PoolStringArray get_inheriters_from_class ( String class ) const

Returns the names of all the classes that directly or indirectly inherit from class.

String get_parent_class ( String class ) const

Returns the parent class of class.

Variant instance ( String class ) const

Creates an instance of class.

bool is_class_enabled ( String class ) const

Returns whether this class is enabled or not.

bool is_parent_class ( String class, String inherits ) const

Returns whether inherits is an ancestor of class or not.

© 2014–2021 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.3/classes/class_classdb.html