ClassDB

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Provides access to metadata stored for every available engine class.

Note: Script-defined classes with class_name are not part of ClassDB, so they will not return reflection data such as a method or property list. However, GDExtension-defined classes are part of ClassDB, so they will return reflection data.

Index

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

func CanInstantiate(class_ string) bool

Returns true if objects can be instantiated from the specified 'class', otherwise returns false.

func ClassCallStatic

func ClassCallStatic(class_ string, method string, args ...any) any

Calls a static method on a class.

func ClassExists

func ClassExists(class_ string) bool

Returns whether the specified 'class' is available or not.

func ClassGetEnumConstants

func ClassGetEnumConstants(class_ string, enum string, no_inheritance bool) []string

Returns an array with all the keys in 'enum' of 'class' or its ancestry.

func ClassGetEnumList

func ClassGetEnumList(class_ string, no_inheritance bool) []string

Returns an array with all the enums of 'class' or its ancestry.

func ClassGetIntegerConstant

func ClassGetIntegerConstant(class_ string, name string) int

Returns the value of the integer constant 'name' of 'class' or its ancestry. Always returns 0 when the constant could not be found.

func ClassGetIntegerConstantEnum

func ClassGetIntegerConstantEnum(class_ string, name string, no_inheritance bool) string

Returns which enum the integer constant 'name' of 'class' or its ancestry belongs to.

func ClassGetIntegerConstantList

func ClassGetIntegerConstantList(class_ string, no_inheritance bool) []string

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

func ClassGetMethodArgumentCount

func ClassGetMethodArgumentCount(class_ string, method string, no_inheritance bool) int

Returns the number of arguments of the method 'method' of 'class' or its ancestry if 'no_inheritance' is false.

func ClassGetMethodList

func ClassGetMethodList(class_ string, no_inheritance bool) []Object.PropertyInfo

Returns an array with all the methods of 'class' or its ancestry if 'no_inheritance' is false. Every element of the array is a data structure 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.

func ClassGetProperty

func ClassGetProperty(obj Object.Instance, property string) any

Returns the value of 'property' of 'object' or its ancestry.

func ClassGetPropertyDefaultValue

func ClassGetPropertyDefaultValue(class_ string, property string) any

Returns the default value of 'property' of 'class' or its ancestor classes.

func ClassGetPropertyGetter

func ClassGetPropertyGetter(class_ string, property string) string

Returns the getter method name of 'property' of 'class'.

func ClassGetPropertyList

func ClassGetPropertyList(class_ string, no_inheritance bool) []Object.PropertyInfo

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

func ClassGetPropertySetter

func ClassGetPropertySetter(class_ string, property string) string

Returns the setter method name of 'property' of 'class'.

func ClassHasEnum

func ClassHasEnum(class_ string, name string, no_inheritance bool) bool

Returns whether 'class' or its ancestry has an enum called 'name' or not.

func ClassHasIntegerConstant

func ClassHasIntegerConstant(class_ string, name string) bool

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

func ClassHasMethod

func ClassHasMethod(class_ string, method string, no_inheritance bool) bool

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

func ClassHasSignal

func ClassHasSignal(class_ string, signal string) bool

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

func ClassSetProperty

func ClassSetProperty(obj Object.Instance, property string, value any) error

Sets 'property' value of 'object' to 'value'.

func GetClassList

func GetClassList() []string

Returns the names of all engine classes available.

Note: Script-defined classes with class_name are not included in this list. Use ProjectSettings.GetGlobalClassList to get a list of script-defined classes instead.

func GetInheritersFromClass

func GetInheritersFromClass(class_ string) []string

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

func GetParentClass

func GetParentClass(class_ string) string

Returns the parent class of 'class'.

func Instantiate

func Instantiate(class_ string) any

Creates an instance of 'class'.

func IsClassEnabled

func IsClassEnabled(class_ string) bool

Returns whether this 'class' is enabled or not.

func IsClassEnumBitfield

func IsClassEnumBitfield(class_ string, enum string, no_inheritance bool) bool

Returns whether 'class' (or its ancestor classes if 'no_inheritance' is false) has an enum called 'enum' that is a bitfield.

func IsParentClass

func IsParentClass(class_ string, inherits string) bool

Returns whether 'inherits' is an ancestor of 'class' or not.

Types

type APIType

type APIType int //gd:ClassDB.APIType
const (
	// Native Core class type.
	ApiCore APIType = 0
	// Native Editor class type.
	ApiEditor APIType = 1
	// GDExtension class type.
	ApiExtension APIType = 2
	// GDExtension Editor class type.
	ApiEditorExtension APIType = 3
	// Unknown class type.
	ApiNone APIType = 4
)

func ClassGetApiType

func ClassGetApiType(class_ string) APIType

Returns the API type of the specified 'class'.

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.ClassDB

Instance of the class with convieniently typed arguments and results.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type MethodFlags

type MethodFlags int //gd:MethodFlags
const (
	// Flag for a normal method.
	MethodFlagNormal MethodFlags = 1
	// Flag for an editor method.
	MethodFlagEditor MethodFlags = 2
	// Flag for a constant method.
	MethodFlagConst MethodFlags = 4
	// Flag for a virtual method.
	MethodFlagVirtual MethodFlags = 8
	// Flag for a method with a variable number of arguments.
	MethodFlagVararg MethodFlags = 16
	// Flag for a static method.
	MethodFlagStatic MethodFlags = 32
	// Used internally. Allows to not dump core virtual methods (such as [Object.Notification]) to the JSON API.
	//
	// [Object.Notification]: https://pkg.go.dev/graphics.gd/variant/Object#Notification
	MethodFlagObjectCore MethodFlags = 64
	// Flag for a virtual method that is required. In GDScript, this flag is set for abstract functions.
	MethodFlagVirtualRequired MethodFlags = 128
	// Default method flags (normal).
	MethodFlagsDefault MethodFlags = 1
)

type PropertyHint

type PropertyHint int //gd:PropertyHint
const (
	// The property has no hint for the editor.
	PropertyHintNone PropertyHint = 0
	// Hints that an int or [Float.X] property should be within a range specified via the hint string "min,max" or "min,max,step". The hint string can optionally include "or_greater" and/or "or_less" to allow manual input going respectively above the max or below the min values.
	//
	// Example: "-360,360,1,or_greater,or_less".
	//
	// Additionally, other keywords can be included: "exp" for exponential range editing, "radians_as_degrees" for editing radian angles in degrees (the range values are also in degrees), "degrees" to hint at an angle and "hide_slider" to hide the slider.
	//
	// [Float.X]: https://pkg.go.dev/graphics.gd/variant/Float#X
	PropertyHintRange PropertyHint = 1
	// Hints that an int or string property is an enumerated value to pick in a list specified via a hint string.
	//
	// The hint string is a comma separated list of names such as "Hello,Something,Else". Whitespaces are not removed from either end of a name. For integer properties, the first name in the list has value 0, the next 1, and so on. Explicit values can also be specified by appending :integer to the name, e.g. "Zero,One,Three:3,Four,Six:6".
	PropertyHintEnum PropertyHint = 2
	// Hints that a string property can be an enumerated value to pick in a list specified via a hint string such as "Hello,Something,Else".
	//
	// Unlike [PropertyHintEnum], a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values.
	PropertyHintEnumSuggestion PropertyHint = 3
	// Hints that a [Float.X] property should be edited via an exponential easing function. The hint string can include "attenuation" to flip the curve horizontally and/or "positive_only" to exclude in/out easing and limit values to be greater than or equal to zero.
	//
	// [Float.X]: https://pkg.go.dev/graphics.gd/variant/Float#X
	PropertyHintExpEasing PropertyHint = 4
	// Hints that a vector property should allow its components to be linked. For example, this allows [Vector2.X] and [Vector2.Y] to be edited together.
	//
	// [Vector2.X]: https://pkg.go.dev/graphics.gd/classdb/Vector2#Instance.X
	// [Vector2.Y]: https://pkg.go.dev/graphics.gd/classdb/Vector2#Instance.Y
	PropertyHintLink PropertyHint = 5
	// Hints that an int property is a bitmask with named bit flags.
	//
	// The hint string is a comma separated list of names such as "Bit0,Bit1,Bit2,Bit3". Whitespaces are not removed from either end of a name. The first name in the list has value 1, the next 2, then 4, 8, 16 and so on. Explicit values can also be specified by appending :integer to the name, e.g. "A:4,B:8,C:16". You can also combine several flags ("A:4,B:8,AB:12,C:16").
	//
	// Note: A flag value must be at least 1 and at most 2 ** 32 - 1.
	//
	// Note: Unlike [PropertyHintEnum], the previous explicit value is not taken into account. For the hint "A:16,B,C", A is 16, B is 2, C is 4.
	PropertyHintFlags PropertyHint = 6
	// Hints that an int property is a bitmask using the optionally named 2D render layers.
	PropertyHintLayers2dRender PropertyHint = 7
	// Hints that an int property is a bitmask using the optionally named 2D physics layers.
	PropertyHintLayers2dPhysics PropertyHint = 8
	// Hints that an int property is a bitmask using the optionally named 2D navigation layers.
	PropertyHintLayers2dNavigation PropertyHint = 9
	// Hints that an int property is a bitmask using the optionally named 3D render layers.
	PropertyHintLayers3dRender PropertyHint = 10
	// Hints that an int property is a bitmask using the optionally named 3D physics layers.
	PropertyHintLayers3dPhysics PropertyHint = 11
	// Hints that an int property is a bitmask using the optionally named 3D navigation layers.
	PropertyHintLayers3dNavigation PropertyHint = 12
	// Hints that an integer property is a bitmask using the optionally named avoidance layers.
	PropertyHintLayersAvoidance PropertyHint = 37
	// Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like "*.png,*.jpg". By default the file will be stored as UID whenever available. You can use [ResourceUID] methods to convert it back to path. For storing a raw path, use [PropertyHintFilePath].
	//
	// [ResourceUID]: https://pkg.go.dev/graphics.gd/classdb/ResourceUID
	PropertyHintFile PropertyHint = 13
	// Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path.
	PropertyHintDir PropertyHint = 14
	// Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards, like "*.png,*.jpg".
	PropertyHintGlobalFile PropertyHint = 15
	// Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path.
	PropertyHintGlobalDir PropertyHint = 16
	// Hints that a property is an instance of a [Resource]-derived type, optionally specified via the hint string (e.g. "Texture2D"). Editing it will show a popup menu of valid resource types to instantiate.
	//
	// [Resource]: https://pkg.go.dev/graphics.gd/classdb/Resource
	PropertyHintResourceType PropertyHint = 17
	// Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed.
	PropertyHintMultilineText PropertyHint = 18
	// Hints that a string property is an [Expression].
	//
	// [Expression]: https://pkg.go.dev/graphics.gd/classdb/Expression
	PropertyHintExpression PropertyHint = 19
	// Hints that a string property should show a placeholder text on its input field, if empty. The hint string is the placeholder text to use.
	PropertyHintPlaceholderText PropertyHint = 20
	// Hints that a [Color.RGBA] property should be edited without affecting its transparency ([Color.A] is not editable).
	//
	// [Color.A]: https://pkg.go.dev/graphics.gd/classdb/Color#Instance.A
	// [Color.RGBA]: https://pkg.go.dev/graphics.gd/variant/Color#RGBA
	PropertyHintColorNoAlpha PropertyHint = 21
	// Hints that the property's value is an object encoded as object ID, with its type specified in the hint string. Used by the debugger.
	PropertyHintObjectId PropertyHint = 22
	// If a property is string, hints that the property represents a particular type (class). This allows to select a type from the create dialog. The property will store the selected type as a string.
	//
	// If a property is slice, hints the editor how to show elements. The hint_string must encode nested types using ":" and "/".
	//
	// If a property is data structure, hints the editor how to show elements. The hint_string is the same as slice, with a ";" separating the key and value.
	//
	//
	//
	// [gdscript]
	//
	// # Array of elem_type.
	//
	// hint_string = "%d:" % [elem_type]
	//
	// hint_string = "%d/%d:%s" % [elem_type, elem_hint, elem_hint_string]
	//
	// # Two-dimensional array of elem_type (array of arrays of elem_type).
	//
	// hint_string = "%d:%d:" % [TYPE_ARRAY, elem_type]
	//
	// hint_string = "%d:%d/%d:%s" % [TYPE_ARRAY, elem_type, elem_hint, elem_hint_string]
	//
	// # Three-dimensional array of elem_type (array of arrays of arrays of elem_type).
	//
	// hint_string = "%d:%d:%d:" % [TYPE_ARRAY, TYPE_ARRAY, elem_type]
	//
	// hint_string = "%d:%d:%d/%d:%s" % [TYPE_ARRAY, TYPE_ARRAY, elem_type, elem_hint, elem_hint_string]
	//
	// [/gdscript]
	//
	// [csharp]
	//
	// // Array of elemType.
	//
	// hintString = $"{elemType:D}:";
	//
	// hintString = $"{elemType:}/{elemHint:D}:{elemHintString}";
	//
	// // Two-dimensional array of elemType (array of arrays of elemType).
	//
	// hintString = $"{Variant.Type.Array:D}:{elemType:D}:";
	//
	// hintString = $"{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}";
	//
	// // Three-dimensional array of elemType (array of arrays of arrays of elemType).
	//
	// hintString = $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}:";
	//
	// hintString = $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}";
	//
	// [/csharp]
	//
	//
	//
	// Examples:
	//
	//
	//
	// [gdscript]
	//
	// hint_string = "%d:" % [TYPE_INT] # Array of integers.
	//
	// hint_string = "%d/%d:1,10,1" % [TYPE_INT, PROPERTY_HINT_RANGE] # Array of integers (in range from 1 to 10).
	//
	// hint_string = "%d/%d:Zero,One,Two" % [TYPE_INT, PROPERTY_HINT_ENUM] # Array of integers (an enum).
	//
	// hint_string = "%d/%d:Zero,One,Three:3,Six:6" % [TYPE_INT, PROPERTY_HINT_ENUM] # Array of integers (an enum).
	//
	// hint_string = "%d/%d:*.png" % [TYPE_STRING, PROPERTY_HINT_FILE] # Array of strings (file paths).
	//
	// hint_string = "%d/%d:Texture2D" % [TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # Array of textures.
	//
	//
	//
	// hint_string = "%d:%d:" % [TYPE_ARRAY, TYPE_FLOAT] # Two-dimensional array of floats.
	//
	// hint_string = "%d:%d/%d:" % [TYPE_ARRAY, TYPE_STRING, PROPERTY_HINT_MULTILINE_TEXT] # Two-dimensional array of multiline strings.
	//
	// hint_string = "%d:%d/%d:-1,1,0.1" % [TYPE_ARRAY, TYPE_FLOAT, PROPERTY_HINT_RANGE] # Two-dimensional array of floats (in range from -1 to 1).
	//
	// hint_string = "%d:%d/%d:Texture2D" % [TYPE_ARRAY, TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # Two-dimensional array of textures.
	//
	// [/gdscript]
	//
	// [csharp]
	//
	// hintString = $"{Variant.Type.Int:D}/{PropertyHint.Range:D}:1,10,1"; // Array of integers (in range from 1 to 10).
	//
	// hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Two"; // Array of integers (an enum).
	//
	// hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Three:3,Six:6"; // Array of integers (an enum).
	//
	// hintString = $"{Variant.Type.String:D}/{PropertyHint.File:D}:*.png"; // Array of strings (file paths).
	//
	// hintString = $"{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // Array of textures.
	//
	//
	//
	// hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}:"; // Two-dimensional array of floats.
	//
	// hintString = $"{Variant.Type.Array:D}:{Variant.Type.String:D}/{PropertyHint.MultilineText:D}:"; // Two-dimensional array of multiline strings.
	//
	// hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}/{PropertyHint.Range:D}:-1,1,0.1"; // Two-dimensional array of floats (in range from -1 to 1).
	//
	// hintString = $"{Variant.Type.Array:D}:{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // Two-dimensional array of textures.
	//
	// [/csharp]
	//
	//
	//
	// Note: The trailing colon is required for properly detecting built-in types.
	PropertyHintTypeString           PropertyHint = 23
	PropertyHintNodePathToEditedNode PropertyHint = 24
	// Hints that an object is too big to be sent via the debugger.
	PropertyHintObjectTooBig PropertyHint = 25
	// Hints that the hint string specifies valid node types for property of type node path.
	PropertyHintNodePathValidTypes PropertyHint = 26
	// Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the project's directory. The hint string can be a set of filters with wildcards like "*.png,*.jpg". See also [FileDialog.Filters].
	//
	// [FileDialog.Filters]: https://pkg.go.dev/graphics.gd/classdb/FileDialog#Instance.Filters
	PropertyHintSaveFile PropertyHint = 27
	// Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path for the file to be saved at. The dialog has access to the entire filesystem. The hint string can be a set of filters with wildcards like "*.png,*.jpg". See also [FileDialog.Filters].
	//
	// [FileDialog.Filters]: https://pkg.go.dev/graphics.gd/classdb/FileDialog#Instance.Filters
	PropertyHintGlobalSaveFile PropertyHint = 28
	PropertyHintIntIsObjectid  PropertyHint = 29
	// Hints that an int property is a pointer. Used by GDExtension.
	PropertyHintIntIsPointer PropertyHint = 30
	// Hints that a property is an slice with the stored type specified in the hint string. The hint string contains the type of the array (e.g. "String").
	//
	// Use the hint string format from [PropertyHintTypeString] for more control over the stored type.
	PropertyHintArrayType PropertyHint = 31
	// Hints that a property is a data structure with the stored types specified in the hint string. The hint string contains the key and value types separated by a semicolon (e.g. "int;String").
	//
	// Use the hint string format from [PropertyHintTypeString] for more control over the stored types.
	PropertyHintDictionaryType PropertyHint = 38
	// Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country.
	PropertyHintLocaleId PropertyHint = 32
	// Hints that a dictionary property is string translation map. Dictionary keys are locale codes and, values are translated strings.
	PropertyHintLocalizableString PropertyHint = 33
	// Hints that a property is an instance of a [Node]-derived type, optionally specified via the hint string (e.g. "Node2D"). Editing it will show a dialog for picking a node from the scene.
	//
	// [Node]: https://pkg.go.dev/graphics.gd/classdb/Node
	PropertyHintNodeType PropertyHint = 34
	// Hints that a quaternion property should disable the temporary euler editor.
	PropertyHintHideQuaternionEdit PropertyHint = 35
	// Hints that a string property is a password, and every character is replaced with the secret character.
	PropertyHintPassword PropertyHint = 36
	// Hints that a func property should be displayed as a clickable button. When the button is pressed, the callable is called. The hint string specifies the button text and optionally an icon from the "EditorIcons" theme type.
	//
	//
	//
	// "Click me!" - A button with the text "Click me!" and the default "Callable" icon.
	//
	// "Click me!,ColorRect" - A button with the text "Click me!" and the "ColorRect" icon.
	//
	//
	//
	// Note: A func cannot be properly serialized and stored in a file, so it is recommended to use [PropertyUsageEditor] instead of [PropertyUsageDefault].
	PropertyHintToolButton PropertyHint = 39
	// Hints that a property will be changed on its own after setting, such as [AudioStreamPlayer.Playing] or [GPUParticles3D.Emitting].
	//
	// [AudioStreamPlayer.Playing]: https://pkg.go.dev/graphics.gd/classdb/AudioStreamPlayer#Instance.Playing
	// [GPUParticles3D.Emitting]: https://pkg.go.dev/graphics.gd/classdb/GPUParticles3D#Instance.Emitting
	PropertyHintOneshot PropertyHint = 40
	// Hints that a boolean property will enable the feature associated with the group that it occurs in. The property will be displayed as a checkbox on the group header. Only works within a group or subgroup.
	//
	// By default, disabling the property hides all properties in the group. Use the optional hint string "checkbox_only" to disable this behavior.
	PropertyHintGroupEnable PropertyHint = 42
	// Hints that a string or string property is the name of an input action. This allows the selection of any action name from the Input Map in the Project Settings. The hint string may contain two options separated by commas:
	//
	// - If it contains "show_builtin", built-in input actions are included in the selection.
	//
	// - If it contains "loose_mode", loose mode is enabled. This allows inserting any action name even if it's not present in the input map.
	PropertyHintInputName PropertyHint = 43
	// Like [PropertyHintFile], but the property is stored as a raw path, not UID. That means the reference will be broken if you move the file. Consider using [PropertyHintFile] when possible.
	PropertyHintFilePath PropertyHint = 44
	// Represents the size of the [PropertyHint] enum.
	PropertyHintMax PropertyHint = 45
)

type PropertyUsageFlags

type PropertyUsageFlags int //gd:PropertyUsageFlags
const (
	// The property is not stored, and does not display in the editor. This is the default for non-exported properties.
	PropertyUsageNone PropertyUsageFlags = 0
	// The property is serialized and saved in the scene file (default for exported properties).
	PropertyUsageStorage PropertyUsageFlags = 2
	// The property is shown in the [EditorInspector] (default for exported properties).
	//
	// [EditorInspector]: https://pkg.go.dev/graphics.gd/classdb/EditorInspector
	PropertyUsageEditor PropertyUsageFlags = 4
	// The property is excluded from the class reference.
	PropertyUsageInternal PropertyUsageFlags = 8
	// The property can be checked in the [EditorInspector].
	//
	// [EditorInspector]: https://pkg.go.dev/graphics.gd/classdb/EditorInspector
	PropertyUsageCheckable PropertyUsageFlags = 16
	// The property is checked in the [EditorInspector].
	//
	// [EditorInspector]: https://pkg.go.dev/graphics.gd/classdb/EditorInspector
	PropertyUsageChecked PropertyUsageFlags = 32
	// Used to group properties together in the editor. See [EditorInspector].
	//
	// [EditorInspector]: https://pkg.go.dev/graphics.gd/classdb/EditorInspector
	PropertyUsageGroup PropertyUsageFlags = 64
	// Used to categorize properties together in the editor.
	PropertyUsageCategory PropertyUsageFlags = 128
	// Used to group properties together in the editor in a subgroup (under a group). See [EditorInspector].
	//
	// [EditorInspector]: https://pkg.go.dev/graphics.gd/classdb/EditorInspector
	PropertyUsageSubgroup PropertyUsageFlags = 256
	// The property is a bitfield, i.e. it contains multiple flags represented as bits.
	PropertyUsageClassIsBitfield PropertyUsageFlags = 512
	// The property does not save its state in [PackedScene].
	//
	// [PackedScene]: https://pkg.go.dev/graphics.gd/classdb/PackedScene
	PropertyUsageNoInstanceState PropertyUsageFlags = 1024
	// Editing the property prompts the user for restarting the editor.
	PropertyUsageRestartIfChanged PropertyUsageFlags = 2048
	// The property is a script variable. [PropertyUsageScriptVariable] can be used to distinguish between exported script variables from built-in variables (which don't have this usage flag). By default, [PropertyUsageScriptVariable] is not applied to variables that are created by overriding [Object.GetPropertyList] in a script.
	//
	// [Object.GetPropertyList]: https://pkg.go.dev/graphics.gd/variant/Object#GetPropertyList
	PropertyUsageScriptVariable PropertyUsageFlags = 4096
	// The property value of type [Object] will be stored even if its value is null.
	//
	// [Object]: https://pkg.go.dev/graphics.gd/variant/Object
	PropertyUsageStoreIfNull PropertyUsageFlags = 8192
	// If this property is modified, all inspector fields will be refreshed.
	PropertyUsageUpdateAllIfModified PropertyUsageFlags = 16384
	PropertyUsageScriptDefaultValue  PropertyUsageFlags = 32768
	// The property is a variable of enum type, i.e. it only takes named integer constants from its associated enumeration.
	PropertyUsageClassIsEnum PropertyUsageFlags = 65536
	// If property has nil as default value, its type will be any.
	PropertyUsageNilIsVariant PropertyUsageFlags = 131072
	// The property is an array.
	PropertyUsageArray PropertyUsageFlags = 262144
	// When duplicating a resource with [Resource.Duplicate], and this flag is set on a property of that resource, the property should always be duplicated, regardless of the subresources bool parameter.
	//
	// [Resource.Duplicate]: https://pkg.go.dev/graphics.gd/classdb/Resource#Instance.Duplicate
	PropertyUsageAlwaysDuplicate PropertyUsageFlags = 524288
	// When duplicating a resource with [Resource.Duplicate], and this flag is set on a property of that resource, the property should never be duplicated, regardless of the subresources bool parameter.
	//
	// [Resource.Duplicate]: https://pkg.go.dev/graphics.gd/classdb/Resource#Instance.Duplicate
	PropertyUsageNeverDuplicate PropertyUsageFlags = 1048576
	// The property is only shown in the editor if modern renderers are supported (the Compatibility rendering method is excluded).
	PropertyUsageHighEndGfx PropertyUsageFlags = 2097152
	// The node path property will always be relative to the scene's root. Mostly useful for local resources.
	PropertyUsageNodePathFromSceneRoot PropertyUsageFlags = 4194304
	// Use when a resource is created on the fly, i.e. the getter will always return a different instance. [ResourceSaver] needs this information to properly save such resources.
	//
	// [ResourceSaver]: https://pkg.go.dev/graphics.gd/classdb/ResourceSaver
	PropertyUsageResourceNotPersistent PropertyUsageFlags = 8388608
	// Inserting an animation key frame of this property will automatically increment the value, allowing to easily keyframe multiple values in a row.
	PropertyUsageKeyingIncrements    PropertyUsageFlags = 16777216
	PropertyUsageDeferredSetResource PropertyUsageFlags = 33554432
	// When this property is a [Resource] and base object is a [Node], a resource instance will be automatically created whenever the node is created in the editor.
	//
	// [Node]: https://pkg.go.dev/graphics.gd/classdb/Node
	// [Resource]: https://pkg.go.dev/graphics.gd/classdb/Resource
	PropertyUsageEditorInstantiateObject PropertyUsageFlags = 67108864
	// The property is considered a basic setting and will appear even when advanced mode is disabled. Used for project settings.
	PropertyUsageEditorBasicSetting PropertyUsageFlags = 134217728
	// The property is read-only in the [EditorInspector].
	//
	// [EditorInspector]: https://pkg.go.dev/graphics.gd/classdb/EditorInspector
	PropertyUsageReadOnly PropertyUsageFlags = 268435456
	// An export preset property with this flag contains confidential information and is stored separately from the rest of the export preset configuration.
	PropertyUsageSecret PropertyUsageFlags = 536870912
	// Default usage (storage and editor).
	PropertyUsageDefault PropertyUsageFlags = 6
	// Default usage but without showing the property in the editor (storage).
	PropertyUsageNoEditor PropertyUsageFlags = 2
)

type SignalInfo

type SignalInfo struct {
	Name        string                `gd:"name"`
	Flags       int                   `gd:"flags"`
	ID          int                   `gd:"id"`
	DefaultArgs []interface{}         `gd:"default_args"`
	Args        []Object.PropertyInfo `gd:"args"`
}

func ClassGetSignal

func ClassGetSignal(class_ string, signal string) SignalInfo

Returns the 'signal' data of 'class' or its ancestry. The returned value is a data structure with the following keys: args, default_args, flags, id, name, return: (class_name, hint, hint_string, name, type, usage).

func ClassGetSignalList

func ClassGetSignalList(class_ string, no_inheritance bool) []SignalInfo

Returns an array with all the signals of 'class' or its ancestry if 'no_inheritance' is false. Every element of the array is a data structure as described in ClassGetSignal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL