Documentation ¶
Overview ¶
Package ClassDB provides methods for working with ClassDB object instances.
Index ¶
- func Advanced() class
- func CanInstantiate(class_ string) bool
- func ClassExists(class_ string) bool
- func ClassGetEnumConstants(class_ string, enum string) []string
- func ClassGetEnumList(class_ string) []string
- func ClassGetIntegerConstant(class_ string, name string) int
- func ClassGetIntegerConstantEnum(class_ string, name string) string
- func ClassGetIntegerConstantList(class_ string) []string
- func ClassGetMethodArgumentCount(class_ string, method string) int
- func ClassGetProperty(obj Object.Instance, property string) any
- func ClassGetPropertyDefaultValue(class_ string, property string) any
- func ClassHasEnum(class_ string, name string) bool
- func ClassHasIntegerConstant(class_ string, name string) bool
- func ClassHasMethod(class_ string, method string) bool
- func ClassHasSignal(class_ string, signal string) bool
- func ClassSetProperty(obj Object.Instance, property string, value any) error
- func GetClassList() []string
- func GetInheritersFromClass(class_ string) []string
- func GetParentClass(class_ string) string
- func Instantiate(class_ string) any
- func IsClassEnabled(class_ string) bool
- func IsClassEnumBitfield(class_ string, enum string) bool
- func IsParentClass(class_ string, inherits string) bool
- type Error
- type PropertyInfo
- type SignalInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Advanced ¶
func Advanced() class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
func CanInstantiate ¶
Returns [code]true[/code] if objects can be instantiated from the specified [param class], otherwise returns [code]false[/code].
func ClassExists ¶
Returns whether the specified [param class] is available or not.
func ClassGetEnumConstants ¶
Returns an array with all the keys in [param enum] of [param class] or its ancestry.
func ClassGetEnumList ¶
Returns an array with all the enums of [param class] or its ancestry.
func ClassGetIntegerConstant ¶
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.
func ClassGetIntegerConstantEnum ¶
Returns which enum the integer constant [param name] of [param class] or its ancestry belongs to.
func ClassGetIntegerConstantList ¶
Returns an array with the names all the integer constants of [param class] or its ancestry.
func ClassGetMethodArgumentCount ¶
Returns the number of arguments of the method [param method] of [param class] or its ancestry if [param no_inheritance] is [code]false[/code].
func ClassGetProperty ¶
Returns the value of [param property] of [param object] or its ancestry.
func ClassGetPropertyDefaultValue ¶
Returns the default value of [param property] of [param class] or its ancestor classes.
func ClassHasEnum ¶
Returns whether [param class] or its ancestry has an enum called [param name] or not.
func ClassHasIntegerConstant ¶
Returns whether [param class] or its ancestry has an integer constant called [param name] or not.
func ClassHasMethod ¶
Returns whether [param class] (or its ancestry if [param no_inheritance] is [code]false[/code]) has a method called [param method] or not.
func ClassHasSignal ¶
Returns whether [param class] or its ancestry has a signal called [param signal] or not.
func ClassSetProperty ¶
Sets [param property] value of [param object] to [param value].
func GetInheritersFromClass ¶
Returns the names of all the classes that directly or indirectly inherit from [param class].
func GetParentClass ¶
Returns the parent class of [param class].
func IsClassEnabled ¶
Returns whether this [param class] is enabled or not.
func IsClassEnumBitfield ¶
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.
func IsParentClass ¶
Returns whether [param inherits] is an ancestor of [param class] or not.
Types ¶
type Error ¶
const ( /*Methods that return [enum Error] return [constant OK] when no error occurred. Since [constant OK] has value 0, and all other error constants are positive integers, it can also be used in boolean checks. [b]Example:[/b] [codeblock] var error = method_that_returns_error() if error != OK: printerr("Failure!") # Or, alternatively: if error: printerr("Still failing!") [/codeblock] [b]Note:[/b] Many functions do not return an error code, but will print error messages to standard output.*/ Ok Error = 0 /*Generic error.*/ Failed Error = 1 ErrUnavailable Error = 2 /*Unconfigured error.*/ ErrUnconfigured Error = 3 ErrUnauthorized Error = 4 /*Parameter range error.*/ ErrParameterRangeError Error = 5 /*Out of memory (OOM) error.*/ ErrOutOfMemory Error = 6 /*File: Not found error.*/ ErrFileNotFound Error = 7 /*File: Bad drive error.*/ ErrFileBadDrive Error = 8 /*File: Bad path error.*/ ErrFileBadPath Error = 9 /*File: No permission error.*/ ErrFileNoPermission Error = 10 /*File: Already in use error.*/ ErrFileAlreadyInUse Error = 11 /*File: Can't open error.*/ ErrFileCantOpen Error = 12 /*File: Can't write error.*/ ErrFileCantWrite Error = 13 /*File: Can't read error.*/ ErrFileCantRead Error = 14 /*File: Unrecognized error.*/ ErrFileUnrecognized Error = 15 /*File: Corrupt error.*/ ErrFileCorrupt Error = 16 /*File: Missing dependencies error.*/ ErrFileMissingDependencies Error = 17 /*File: End of file (EOF) error.*/ ErrFileEof Error = 18 /*Can't open error.*/ ErrCantOpen Error = 19 /*Can't create error.*/ ErrCantCreate Error = 20 /*Query failed error.*/ ErrQueryFailed Error = 21 /*Already in use error.*/ ErrAlreadyInUse Error = 22 /*Locked error.*/ ErrLocked Error = 23 /*Timeout error.*/ ErrTimeout Error = 24 /*Can't connect error.*/ ErrCantConnect Error = 25 /*Can't resolve error.*/ ErrCantResolve Error = 26 /*Connection error.*/ ErrConnectionError Error = 27 /*Can't acquire resource error.*/ ErrCantAcquireResource Error = 28 /*Can't fork process error.*/ ErrCantFork Error = 29 /*Invalid data error.*/ ErrInvalidData Error = 30 /*Invalid parameter error.*/ ErrInvalidParameter Error = 31 /*Already exists error.*/ ErrAlreadyExists Error = 32 /*Does not exist error.*/ ErrDoesNotExist Error = 33 /*Database: Read error.*/ ErrDatabaseCantRead Error = 34 /*Database: Write error.*/ ErrDatabaseCantWrite Error = 35 /*Compilation failed error.*/ ErrCompilationFailed Error = 36 /*Method not found error.*/ ErrMethodNotFound Error = 37 /*Linking failed error.*/ ErrLinkFailed Error = 38 /*Script failed error.*/ ErrScriptFailed Error = 39 /*Cycling link (import cycle) error.*/ ErrCyclicLink Error = 40 /*Invalid declaration error.*/ ErrInvalidDeclaration Error = 41 /*Duplicate symbol error.*/ ErrDuplicateSymbol Error = 42 /*Parse error.*/ ErrParseError Error = 43 /*Busy error.*/ ErrBusy Error = 44 /*Skip error.*/ ErrSkip Error = 45 /*Help error. Used internally when passing [code]--version[/code] or [code]--help[/code] as executable options.*/ ErrHelp Error = 46 /*Bug error, caused by an implementation issue in the method. [b]Note:[/b] If a built-in method returns this code, please open an issue on [url=https://github.com/godotengine/godot/issues]the GitHub Issue Tracker[/url].*/ ErrBug Error = 47 /*Printer on fire error (This is an easter egg, no built-in methods return this error code).*/ ErrPrinterOnFire Error = 48 )
type PropertyInfo ¶
type PropertyInfo struct { ClassName string `gd:"class_name"` Name string `gd:"name"` Hint int `gd:"hint"` HintString string `gd:"hint_string"` Type reflect.Type `gd:"type"` Usage int `gd:"usage"` }
func ClassGetMethodList ¶
func ClassGetMethodList(class_ string) []PropertyInfo
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]. [b]Note:[/b] In exported release builds the debug info is not available, so the returned dictionaries will contain only method names.
func ClassGetPropertyList ¶
func ClassGetPropertyList(class_ string) []PropertyInfo
Returns an array with all the properties of [param class] or its ancestry if [param no_inheritance] is [code]false[/code].
type SignalInfo ¶
type SignalInfo struct { Name string `gd:"name"` Flags int `gd:"flags"` ID int `gd:"id"` DefaultArgs []interface{} `gd:"default_args"` Args []PropertyInfo `gd:"args"` }
func ClassGetSignal ¶
func ClassGetSignal(class_ string, signal string) SignalInfo
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].
func ClassGetSignalList ¶
func ClassGetSignalList(class_ string) []SignalInfo
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].