0.2.0-dev Download ZIP
279 lines ·12.5 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="ClassDB" inherits="Object" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A class information repository. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | Provides access to metadata stored for every available engine class. |
| 8 | [b]Note:[/b] Script-defined classes with [code]class_name[/code] are not part of [ClassDB], so they will not return reflection data such as a method or property list. However, [GDExtension]-defined classes [i]are[/i] part of [ClassDB], so they will return reflection data. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | </tutorials> |
| 12 | <methods> |
| 13 | <method name="can_instantiate" qualifiers="const"> |
| 14 | <return type="bool" /> |
| 15 | <param index="0" name="class" type="StringName" /> |
| 16 | <description> |
| 17 | Returns [code]true[/code] if objects can be instantiated from the specified [param class], otherwise returns [code]false[/code]. |
| 18 | </description> |
| 19 | </method> |
| 20 | <method name="class_call_static" qualifiers="vararg"> |
| 21 | <return type="Variant" /> |
| 22 | <param index="0" name="class" type="StringName" /> |
| 23 | <param index="1" name="method" type="StringName" /> |
| 24 | <description> |
| 25 | Calls a static method on a class. |
| 26 | </description> |
| 27 | </method> |
| 28 | <method name="class_exists" qualifiers="const"> |
| 29 | <return type="bool" /> |
| 30 | <param index="0" name="class" type="StringName" /> |
| 31 | <description> |
| 32 | Returns whether the specified [param class] is available or not. |
| 33 | </description> |
| 34 | </method> |
| 35 | <method name="class_get_api_type" qualifiers="const"> |
| 36 | <return type="int" enum="ClassDB.APIType" /> |
| 37 | <param index="0" name="class" type="StringName" /> |
| 38 | <description> |
| 39 | Returns the API type of the specified [param class]. |
| 40 | </description> |
| 41 | </method> |
| 42 | <method name="class_get_enum_constants" qualifiers="const"> |
| 43 | <return type="PackedStringArray" /> |
| 44 | <param index="0" name="class" type="StringName" /> |
| 45 | <param index="1" name="enum" type="StringName" /> |
| 46 | <param index="2" name="no_inheritance" type="bool" default="false" /> |
| 47 | <description> |
| 48 | Returns an array with all the keys in [param enum] of [param class] or its ancestry. |
| 49 | </description> |
| 50 | </method> |
| 51 | <method name="class_get_enum_list" qualifiers="const"> |
| 52 | <return type="PackedStringArray" /> |
| 53 | <param index="0" name="class" type="StringName" /> |
| 54 | <param index="1" name="no_inheritance" type="bool" default="false" /> |
| 55 | <description> |
| 56 | Returns an array with all the enums of [param class] or its ancestry. |
| 57 | </description> |
| 58 | </method> |
| 59 | <method name="class_get_integer_constant" qualifiers="const"> |
| 60 | <return type="int" /> |
| 61 | <param index="0" name="class" type="StringName" /> |
| 62 | <param index="1" name="name" type="StringName" /> |
| 63 | <description> |
| 64 | Returns the value of the integer constant [param name] of [param class] or its ancestry. Always returns 0 when the constant could not be found. |
| 65 | </description> |
| 66 | </method> |
| 67 | <method name="class_get_integer_constant_enum" qualifiers="const"> |
| 68 | <return type="StringName" /> |
| 69 | <param index="0" name="class" type="StringName" /> |
| 70 | <param index="1" name="name" type="StringName" /> |
| 71 | <param index="2" name="no_inheritance" type="bool" default="false" /> |
| 72 | <description> |
| 73 | Returns which enum the integer constant [param name] of [param class] or its ancestry belongs to. |
| 74 | </description> |
| 75 | </method> |
| 76 | <method name="class_get_integer_constant_list" qualifiers="const"> |
| 77 | <return type="PackedStringArray" /> |
| 78 | <param index="0" name="class" type="StringName" /> |
| 79 | <param index="1" name="no_inheritance" type="bool" default="false" /> |
| 80 | <description> |
| 81 | Returns an array with the names all the integer constants of [param class] or its ancestry. |
| 82 | </description> |
| 83 | </method> |
| 84 | <method name="class_get_method_argument_count" qualifiers="const"> |
| 85 | <return type="int" /> |
| 86 | <param index="0" name="class" type="StringName" /> |
| 87 | <param index="1" name="method" type="StringName" /> |
| 88 | <param index="2" name="no_inheritance" type="bool" default="false" /> |
| 89 | <description> |
| 90 | Returns the number of arguments of the method [param method] of [param class] or its ancestry if [param no_inheritance] is [code]false[/code]. |
| 91 | </description> |
| 92 | </method> |
| 93 | <method name="class_get_method_list" qualifiers="const"> |
| 94 | <return type="Dictionary[]" /> |
| 95 | <param index="0" name="class" type="StringName" /> |
| 96 | <param index="1" name="no_inheritance" type="bool" default="false" /> |
| 97 | <description> |
| 98 | Returns an array with all the methods of [param class] or its ancestry if [param no_inheritance] is [code]false[/code]. Every element of the array is a [Dictionary] with the following keys: [code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/code], [code]return: (class_name, hint, hint_string, name, type, usage)[/code]. |
| 99 | [b]Note:[/b] In exported release builds the debug info is not available, so the returned dictionaries will contain only method names. |
| 100 | </description> |
| 101 | </method> |
| 102 | <method name="class_get_property" qualifiers="const"> |
| 103 | <return type="Variant" /> |
| 104 | <param index="0" name="object" type="Object" /> |
| 105 | <param index="1" name="property" type="StringName" /> |
| 106 | <description> |
| 107 | Returns the value of [param property] of [param object] or its ancestry. |
| 108 | </description> |
| 109 | </method> |
| 110 | <method name="class_get_property_default_value" qualifiers="const"> |
| 111 | <return type="Variant" /> |
| 112 | <param index="0" name="class" type="StringName" /> |
| 113 | <param index="1" name="property" type="StringName" /> |
| 114 | <description> |
| 115 | Returns the default value of [param property] of [param class] or its ancestor classes. |
| 116 | </description> |
| 117 | </method> |
| 118 | <method name="class_get_property_getter"> |
| 119 | <return type="StringName" /> |
| 120 | <param index="0" name="class" type="StringName" /> |
| 121 | <param index="1" name="property" type="StringName" /> |
| 122 | <description> |
| 123 | Returns the getter method name of [param property] of [param class]. |
| 124 | </description> |
| 125 | </method> |
| 126 | <method name="class_get_property_list" qualifiers="const"> |
| 127 | <return type="Dictionary[]" /> |
| 128 | <param index="0" name="class" type="StringName" /> |
| 129 | <param index="1" name="no_inheritance" type="bool" default="false" /> |
| 130 | <description> |
| 131 | Returns an array with all the properties of [param class] or its ancestry if [param no_inheritance] is [code]false[/code]. |
| 132 | </description> |
| 133 | </method> |
| 134 | <method name="class_get_property_setter"> |
| 135 | <return type="StringName" /> |
| 136 | <param index="0" name="class" type="StringName" /> |
| 137 | <param index="1" name="property" type="StringName" /> |
| 138 | <description> |
| 139 | Returns the setter method name of [param property] of [param class]. |
| 140 | </description> |
| 141 | </method> |
| 142 | <method name="class_get_signal" qualifiers="const"> |
| 143 | <return type="Dictionary" /> |
| 144 | <param index="0" name="class" type="StringName" /> |
| 145 | <param index="1" name="signal" type="StringName" /> |
| 146 | <description> |
| 147 | Returns the [param signal] data of [param class] or its ancestry. The returned value is a [Dictionary] with the following keys: [code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/code], [code]return: (class_name, hint, hint_string, name, type, usage)[/code]. |
| 148 | </description> |
| 149 | </method> |
| 150 | <method name="class_get_signal_list" qualifiers="const"> |
| 151 | <return type="Dictionary[]" /> |
| 152 | <param index="0" name="class" type="StringName" /> |
| 153 | <param index="1" name="no_inheritance" type="bool" default="false" /> |
| 154 | <description> |
| 155 | Returns an array with all the signals of [param class] or its ancestry if [param no_inheritance] is [code]false[/code]. Every element of the array is a [Dictionary] as described in [method class_get_signal]. |
| 156 | </description> |
| 157 | </method> |
| 158 | <method name="class_has_enum" qualifiers="const"> |
| 159 | <return type="bool" /> |
| 160 | <param index="0" name="class" type="StringName" /> |
| 161 | <param index="1" name="name" type="StringName" /> |
| 162 | <param index="2" name="no_inheritance" type="bool" default="false" /> |
| 163 | <description> |
| 164 | Returns whether [param class] or its ancestry has an enum called [param name] or not. |
| 165 | </description> |
| 166 | </method> |
| 167 | <method name="class_has_integer_constant" qualifiers="const"> |
| 168 | <return type="bool" /> |
| 169 | <param index="0" name="class" type="StringName" /> |
| 170 | <param index="1" name="name" type="StringName" /> |
| 171 | <description> |
| 172 | Returns whether [param class] or its ancestry has an integer constant called [param name] or not. |
| 173 | </description> |
| 174 | </method> |
| 175 | <method name="class_has_method" qualifiers="const"> |
| 176 | <return type="bool" /> |
| 177 | <param index="0" name="class" type="StringName" /> |
| 178 | <param index="1" name="method" type="StringName" /> |
| 179 | <param index="2" name="no_inheritance" type="bool" default="false" /> |
| 180 | <description> |
| 181 | Returns whether [param class] (or its ancestry if [param no_inheritance] is [code]false[/code]) has a method called [param method] or not. |
| 182 | </description> |
| 183 | </method> |
| 184 | <method name="class_has_signal" qualifiers="const"> |
| 185 | <return type="bool" /> |
| 186 | <param index="0" name="class" type="StringName" /> |
| 187 | <param index="1" name="signal" type="StringName" /> |
| 188 | <description> |
| 189 | Returns whether [param class] or its ancestry has a signal called [param signal] or not. |
| 190 | </description> |
| 191 | </method> |
| 192 | <method name="class_set_property" qualifiers="const"> |
| 193 | <return type="int" enum="Error" /> |
| 194 | <param index="0" name="object" type="Object" /> |
| 195 | <param index="1" name="property" type="StringName" /> |
| 196 | <param index="2" name="value" type="Variant" /> |
| 197 | <description> |
| 198 | Sets [param property] value of [param object] to [param value]. |
| 199 | </description> |
| 200 | </method> |
| 201 | <method name="get_class_list" qualifiers="const"> |
| 202 | <return type="PackedStringArray" /> |
| 203 | <description> |
| 204 | Returns the names of all engine classes available. |
| 205 | [b]Note:[/b] Script-defined classes with [code]class_name[/code] are not included in this list. Use [method ProjectSettings.get_global_class_list] to get a list of script-defined classes instead. |
| 206 | </description> |
| 207 | </method> |
| 208 | <method name="get_inheriters_from_class" qualifiers="const"> |
| 209 | <return type="PackedStringArray" /> |
| 210 | <param index="0" name="class" type="StringName" /> |
| 211 | <description> |
| 212 | Returns the names of all engine classes that directly or indirectly inherit from [param class]. |
| 213 | </description> |
| 214 | </method> |
| 215 | <method name="get_parent_class" qualifiers="const"> |
| 216 | <return type="StringName" /> |
| 217 | <param index="0" name="class" type="StringName" /> |
| 218 | <description> |
| 219 | Returns the parent class of [param class]. |
| 220 | </description> |
| 221 | </method> |
| 222 | <method name="instantiate" qualifiers="const"> |
| 223 | <return type="Variant" /> |
| 224 | <param index="0" name="class" type="StringName" /> |
| 225 | <description> |
| 226 | Creates an instance of [param class]. |
| 227 | </description> |
| 228 | </method> |
| 229 | <method name="is_class_enabled" qualifiers="const"> |
| 230 | <return type="bool" /> |
| 231 | <param index="0" name="class" type="StringName" /> |
| 232 | <description> |
| 233 | Returns whether this [param class] is enabled or not. |
| 234 | </description> |
| 235 | </method> |
| 236 | <method name="is_class_enum_bitfield" qualifiers="const"> |
| 237 | <return type="bool" /> |
| 238 | <param index="0" name="class" type="StringName" /> |
| 239 | <param index="1" name="enum" type="StringName" /> |
| 240 | <param index="2" name="no_inheritance" type="bool" default="false" /> |
| 241 | <description> |
| 242 | Returns whether [param class] (or its ancestor classes if [param no_inheritance] is [code]false[/code]) has an enum called [param enum] that is a bitfield. |
| 243 | </description> |
| 244 | </method> |
| 245 | <method name="is_class_exposed" qualifiers="const"> |
| 246 | <return type="bool" /> |
| 247 | <param index="0" name="class" type="StringName" /> |
| 248 | <description> |
| 249 | Returns whether this [param class] is exposed or not. |
| 250 | Godot uses internal and platform specific classes at run time. [ClassDB] is able to work with those and lists them like any other class. This method can be used to filter them out if your use-case requires it. |
| 251 | </description> |
| 252 | </method> |
| 253 | <method name="is_parent_class" qualifiers="const"> |
| 254 | <return type="bool" /> |
| 255 | <param index="0" name="class" type="StringName" /> |
| 256 | <param index="1" name="inherits" type="StringName" /> |
| 257 | <description> |
| 258 | Returns whether [param inherits] is an ancestor of [param class] or not. |
| 259 | </description> |
| 260 | </method> |
| 261 | </methods> |
| 262 | <constants> |
| 263 | <constant name="API_CORE" value="0" enum="APIType"> |
| 264 | Native Core class type. |
| 265 | </constant> |
| 266 | <constant name="API_EDITOR" value="1" enum="APIType"> |
| 267 | Native Editor class type. |
| 268 | </constant> |
| 269 | <constant name="API_EXTENSION" value="2" enum="APIType"> |
| 270 | GDExtension class type. |
| 271 | </constant> |
| 272 | <constant name="API_EDITOR_EXTENSION" value="3" enum="APIType"> |
| 273 | GDExtension Editor class type. |
| 274 | </constant> |
| 275 | <constant name="API_NONE" value="4" enum="APIType"> |
| 276 | Unknown class type. |
| 277 | </constant> |
| 278 | </constants> |
| 279 | </class> |