Documentation
¶
Overview ¶
Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names.
A tree of nodes is called a scene. Scenes can be saved to the disk and then instantiated into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects.
Scene tree: The graphics.gd/classdb/SceneTree contains the active tree of nodes. When a node is added to the scene tree, it receives the NotificationEnterTree notification and its [Interface.EnterTree] callback is triggered. Child nodes are always added after their parent node, i.e. the [Interface.EnterTree] callback of a parent node will be triggered before its child's.
Once all nodes have been added in the scene tree, they receive the NotificationReady notification and their respective [Interface.Ready] callbacks are triggered. For groups of nodes, the [Interface.Ready] callback is called in reverse order, starting with the children and moving up to the parent nodes.
This means that when adding a node to the scene tree, the following order will be used for the callbacks: [Interface.EnterTree] of the parent, [Interface.EnterTree] of the children, [Interface.Ready] of the children and finally [Interface.Ready] of the parent (recursively for the entire scene tree).
Processing: Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback [Interface.Process], toggled with Instance.SetProcess) happens as fast as possible and is dependent on the frame rate, so the processing time delta (in seconds) is passed as an argument. Physics processing (callback [Interface.PhysicsProcess], toggled with Instance.SetPhysicsProcess) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine.
Nodes can also process input events. When present, the [Interface.Input] function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the [Interface.UnhandledInput] function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI graphics.gd/classdb/Control nodes), ensuring that the node only receives the events that were meant for it.
To keep track of the scene hierarchy (especially when instantiating scenes into other scenes), an "owner" can be set for the node with the Instance.Owner property. This keeps track of who instantiated what. This is mostly useful when writing editors and tools, though.
Finally, when a node is freed with graphics.gd/classdb/Object.Instance.Free or Instance.QueueFree, it will also free all its children.
Groups: Nodes can be added to as many groups as you want to be easy to manage, you could create groups like "enemies" or "collectables" for example, depending on your game. See Instance.AddToGroup, Instance.IsInGroup and Instance.RemoveFromGroup. You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on graphics.gd/classdb/SceneTree.
Networking with nodes: After connecting to a server (or making one, see graphics.gd/classdb/ENetMultiplayerPeer), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling Instance.Rpc with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its node path (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos.
Note: The script property is part of the graphics.gd/classdb/Object class, not graphics.gd/classdb/Node. It isn't exposed like most properties but does have a setter and getter (see graphics.gd/classdb/Object.Instance.SetScript and graphics.gd/classdb/Object.Instance.GetScript).
Index ¶
- Constants
- func GetOrphanNodeIds() []int
- func PrintOrphanNodes()
- type Advanced
- type Any
- type AutoTranslateMode
- type DuplicateFlags
- type Expanded
- func (self Expanded) AddChild(node Instance, force_readable_name bool, internal_ InternalMode)
- func (self Expanded) AddSibling(sibling Instance, force_readable_name bool)
- func (self Expanded) AddToGroup(group string, persistent bool)
- func (self Expanded) Atr(message string, context string) string
- func (self Expanded) AtrN(message string, plural_message string, n int, context string) string
- func (self Expanded) Duplicate(flags int) Instance
- func (self Expanded) FindChild(pattern string, recursive bool, owned bool) Instance
- func (self Expanded) FindChildren(pattern string, atype string, recursive bool, owned bool) []Instance
- func (self Expanded) GetChild(idx int, include_internal bool) Instance
- func (self Expanded) GetChildCount(include_internal bool) int
- func (self Expanded) GetChildren(include_internal bool) []Instance
- func (self Expanded) GetIndex(include_internal bool) int
- func (self Expanded) GetPathTo(node Instance, use_unique_path bool) string
- func (self Expanded) PropagateCall(method string, args []any, parent_first bool)
- func (self Expanded) Reparent(new_parent Instance, keep_global_transform bool)
- func (self Expanded) ReplaceBy(node Instance, keep_groups bool)
- func (self Expanded) SetMultiplayerAuthority(id int, recursive bool)
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AddChild(node Instance)
- func (self Instance) AddSibling(sibling Instance)
- func (self Instance) AddToGroup(group string)
- func (self Instance) AsNode() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) Atr(message string) string
- func (self Instance) AtrN(message string, plural_message string, n int) string
- func (self Instance) AutoTranslateMode() AutoTranslateMode
- func (self Instance) BindNode(peer Tween.Instance) Tween.Instance
- func (self Instance) CallDeferredThreadGroup(method string, args ...any) any
- func (self Instance) CallThreadSafe(method string, args ...any) any
- func (self Instance) CanAutoTranslate() bool
- func (self Instance) CanProcess() bool
- func (self Instance) CreateTween() Tween.Instance
- func (self Instance) Duplicate() Instance
- func (self Instance) EditorDescription() string
- func (self Instance) FindChild(pattern string) Instance
- func (self Instance) FindChildren(pattern string) []Instance
- func (self Instance) FindParent(pattern string) Instance
- func (self Instance) GetAccessibilityElement() RID.AccessibilityElement
- func (self Instance) GetChild(idx int) Instance
- func (self Instance) GetChildCount() int
- func (self Instance) GetChildren() []Instance
- func (self Instance) GetGroups() []string
- func (self Instance) GetIndex() int
- func (self Instance) GetMultiplayerAuthority() int
- func (self Instance) GetNode(path string) Instance
- func (self Instance) GetNodeAndResource(path string) (Instance, Resource.Instance, string)
- func (self Instance) GetNodeOrNull(path string) Instance
- func (self Instance) GetNodeRpcConfig() any
- func (self Instance) GetParent() Instance
- func (self Instance) GetPath() string
- func (self Instance) GetPathTo(node Instance) string
- func (self Instance) GetPhysicsProcessDeltaTime() Float.X
- func (self Instance) GetProcessDeltaTime() Float.X
- func (self Instance) GetSceneInstanceLoadPlaceholder() bool
- func (self Instance) GetTreeString() string
- func (self Instance) GetTreeStringPretty() string
- func (self Instance) HasNode(path string) bool
- func (self Instance) HasNodeAndResource(path string) bool
- func (self Instance) ID() ID
- func (self Instance) IsAncestorOf(node Instance) bool
- func (self Instance) IsDisplayedFolded() bool
- func (self Instance) IsEditableInstance(node Instance) bool
- func (self Instance) IsGreaterThan(node Instance) bool
- func (self Instance) IsInGroup(group string) bool
- func (self Instance) IsInsideTree() bool
- func (self Instance) IsMultiplayerAuthority() bool
- func (self Instance) IsNodeReady() bool
- func (self Instance) IsPartOfEditedScene() bool
- func (self Instance) IsPhysicsInterpolated() bool
- func (self Instance) IsPhysicsInterpolatedAndEnabled() bool
- func (self Instance) IsPhysicsProcessing() bool
- func (self Instance) IsPhysicsProcessingInternal() bool
- func (self Instance) IsProcessing() bool
- func (self Instance) IsProcessingInput() bool
- func (self Instance) IsProcessingInternal() bool
- func (self Instance) IsProcessingShortcutInput() bool
- func (self Instance) IsProcessingUnhandledInput() bool
- func (self Instance) IsProcessingUnhandledKeyInput() bool
- func (self Instance) IsQueuedForDeletion() bool
- func (self Instance) MoveChild(child_node Instance, to_index int)
- func (self Instance) Multiplayer() MultiplayerAPI.Instance
- func (self Instance) Name() string
- func (self Instance) NotifyDeferredThreadGroup(what int)
- func (self Instance) NotifyThreadSafe(what int)
- func (self Instance) OnChildEnteredTree(cb func(node Instance), flags ...Signal.Flags)
- func (self Instance) OnChildExitingTree(cb func(node Instance), flags ...Signal.Flags)
- func (self Instance) OnChildOrderChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnEditorDescriptionChanged(cb func(node Instance), flags ...Signal.Flags)
- func (self Instance) OnEditorStateChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnReady(cb func(), flags ...Signal.Flags)
- func (self Instance) OnRenamed(cb func(), flags ...Signal.Flags)
- func (self Instance) OnReplacingBy(cb func(node Instance), flags ...Signal.Flags)
- func (self Instance) OnTreeEntered(cb func(), flags ...Signal.Flags)
- func (self Instance) OnTreeExited(cb func(), flags ...Signal.Flags)
- func (self Instance) OnTreeExiting(cb func(), flags ...Signal.Flags)
- func (self Instance) Owner() Instance
- func (self Instance) PhysicsInterpolationMode() PhysicsInterpolationMode
- func (self Instance) PrintTree()
- func (self Instance) PrintTreePretty()
- func (self Instance) ProcessMode() ProcessMode
- func (self Instance) ProcessPhysicsPriority() int
- func (self Instance) ProcessPriority() int
- func (self Instance) ProcessThreadGroup() ProcessThreadGroup
- func (self Instance) ProcessThreadGroupOrder() int
- func (self Instance) ProcessThreadMessages() ProcessThreadMessages
- func (self Instance) PropagateCall(method string)
- func (self Instance) PropagateNotification(what int)
- func (self Instance) QueueAccessibilityUpdate()
- func (self Instance) QueueFree()
- func (self Instance) RemoveChild(node Instance)
- func (self Instance) RemoveFromGroup(group string)
- func (self Instance) Reparent(new_parent Instance)
- func (self Instance) ReplaceBy(node Instance)
- func (self Instance) RequestReady()
- func (self Instance) ResetPhysicsInterpolation()
- func (self Instance) Rpc(method string, args ...any) error
- func (self Instance) RpcConfig(method string, config any)
- func (self Instance) RpcId(peer_id int, method string, args ...any) error
- func (self Instance) SceneFilePath() string
- func (self Instance) SetAutoTranslateMode(value AutoTranslateMode)
- func (self Instance) SetDeferredThreadGroup(property string, value any)
- func (self Instance) SetDisplayFolded(fold bool)
- func (self Instance) SetEditableInstance(node Instance, is_editable bool)
- func (self Instance) SetEditorDescription(value string)
- func (self Instance) SetMultiplayerAuthority(id int)
- func (self Instance) SetName(value string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOwner(value Instance)
- func (self Instance) SetPhysicsInterpolationMode(value PhysicsInterpolationMode)
- func (self Instance) SetPhysicsProcess(enable bool)
- func (self Instance) SetPhysicsProcessInternal(enable bool)
- func (self Instance) SetProcess(enable bool)
- func (self Instance) SetProcessInput(enable bool)
- func (self Instance) SetProcessInternal(enable bool)
- func (self Instance) SetProcessMode(value ProcessMode)
- func (self Instance) SetProcessPhysicsPriority(value int)
- func (self Instance) SetProcessPriority(value int)
- func (self Instance) SetProcessShortcutInput(enable bool)
- func (self Instance) SetProcessThreadGroup(value ProcessThreadGroup)
- func (self Instance) SetProcessThreadGroupOrder(value int)
- func (self Instance) SetProcessThreadMessages(value ProcessThreadMessages)
- func (self Instance) SetProcessUnhandledInput(enable bool)
- func (self Instance) SetProcessUnhandledKeyInput(enable bool)
- func (self Instance) SetSceneFilePath(value string)
- func (self Instance) SetSceneInstanceLoadPlaceholder(load_placeholder bool)
- func (self Instance) SetThreadSafe(property string, value any)
- func (self Instance) SetTranslationDomainInherited()
- func (self Instance) SetUniqueNameInOwner(value bool)
- func (self Instance) UniqueNameInOwner() bool
- func (self Instance) UpdateConfigurationWarnings()
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
- type InternalMode
- type PhysicsInterpolationMode
- type ProcessMode
- type ProcessThreadGroup
- type ProcessThreadMessages
Constants ¶
const NotificationAccessibilityInvalidate Object.Notification = 3001 //gd:Node.NOTIFICATION_ACCESSIBILITY_INVALIDATE
const NotificationAccessibilityUpdate Object.Notification = 3000 //gd:Node.NOTIFICATION_ACCESSIBILITY_UPDATE
const NotificationApplicationFocusIn Object.Notification = 2016 //gd:Node.NOTIFICATION_APPLICATION_FOCUS_IN
const NotificationApplicationFocusOut Object.Notification = 2017 //gd:Node.NOTIFICATION_APPLICATION_FOCUS_OUT
const NotificationApplicationPaused Object.Notification = 2015 //gd:Node.NOTIFICATION_APPLICATION_PAUSED
const NotificationApplicationResumed Object.Notification = 2014 //gd:Node.NOTIFICATION_APPLICATION_RESUMED
const NotificationChildOrderChanged Object.Notification = 24 //gd:Node.NOTIFICATION_CHILD_ORDER_CHANGED
const NotificationCrash Object.Notification = 2012 //gd:Node.NOTIFICATION_CRASH
const NotificationDisabled Object.Notification = 28 //gd:Node.NOTIFICATION_DISABLED
const NotificationDragBegin Object.Notification = 21 //gd:Node.NOTIFICATION_DRAG_BEGIN
const NotificationDragEnd Object.Notification = 22 //gd:Node.NOTIFICATION_DRAG_END
const NotificationEditorPostSave Object.Notification = 9002 //gd:Node.NOTIFICATION_EDITOR_POST_SAVE
const NotificationEditorPreSave Object.Notification = 9001 //gd:Node.NOTIFICATION_EDITOR_PRE_SAVE
const NotificationEnabled Object.Notification = 29 //gd:Node.NOTIFICATION_ENABLED
const NotificationEnterTree Object.Notification = 10 //gd:Node.NOTIFICATION_ENTER_TREE
const NotificationExitTree Object.Notification = 11 //gd:Node.NOTIFICATION_EXIT_TREE
const NotificationInternalPhysicsProcess Object.Notification = 26 //gd:Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS
const NotificationInternalProcess Object.Notification = 25 //gd:Node.NOTIFICATION_INTERNAL_PROCESS
const NotificationMovedInParent Object.Notification = 12 //gd:Node.NOTIFICATION_MOVED_IN_PARENT
const NotificationOsImeUpdate Object.Notification = 2013 //gd:Node.NOTIFICATION_OS_IME_UPDATE
const NotificationOsMemoryWarning Object.Notification = 2009 //gd:Node.NOTIFICATION_OS_MEMORY_WARNING
const NotificationParented Object.Notification = 18 //gd:Node.NOTIFICATION_PARENTED
const NotificationPathRenamed Object.Notification = 23 //gd:Node.NOTIFICATION_PATH_RENAMED
const NotificationPaused Object.Notification = 14 //gd:Node.NOTIFICATION_PAUSED
const NotificationPhysicsProcess Object.Notification = 16 //gd:Node.NOTIFICATION_PHYSICS_PROCESS
const NotificationPostEnterTree Object.Notification = 27 //gd:Node.NOTIFICATION_POST_ENTER_TREE
const NotificationProcess Object.Notification = 17 //gd:Node.NOTIFICATION_PROCESS
const NotificationReady Object.Notification = 13 //gd:Node.NOTIFICATION_READY
const NotificationResetPhysicsInterpolation Object.Notification = 2001 //gd:Node.NOTIFICATION_RESET_PHYSICS_INTERPOLATION
const NotificationSceneInstantiated Object.Notification = 20 //gd:Node.NOTIFICATION_SCENE_INSTANTIATED
const NotificationTextServerChanged Object.Notification = 2018 //gd:Node.NOTIFICATION_TEXT_SERVER_CHANGED
const NotificationTranslationChanged Object.Notification = 2010 //gd:Node.NOTIFICATION_TRANSLATION_CHANGED
const NotificationUnparented Object.Notification = 19 //gd:Node.NOTIFICATION_UNPARENTED
const NotificationUnpaused Object.Notification = 15 //gd:Node.NOTIFICATION_UNPAUSED
const NotificationVpMouseEnter Object.Notification = 1010 //gd:Node.NOTIFICATION_VP_MOUSE_ENTER
const NotificationVpMouseExit Object.Notification = 1011 //gd:Node.NOTIFICATION_VP_MOUSE_EXIT
const NotificationWmAbout Object.Notification = 2011 //gd:Node.NOTIFICATION_WM_ABOUT
const NotificationWmCloseRequest Object.Notification = 1006 //gd:Node.NOTIFICATION_WM_CLOSE_REQUEST
const NotificationWmDpiChange Object.Notification = 1009 //gd:Node.NOTIFICATION_WM_DPI_CHANGE
const NotificationWmGoBackRequest Object.Notification = 1007 //gd:Node.NOTIFICATION_WM_GO_BACK_REQUEST
const NotificationWmMouseEnter Object.Notification = 1002 //gd:Node.NOTIFICATION_WM_MOUSE_ENTER
const NotificationWmMouseExit Object.Notification = 1003 //gd:Node.NOTIFICATION_WM_MOUSE_EXIT
const NotificationWmPositionChanged Object.Notification = 1012 //gd:Node.NOTIFICATION_WM_POSITION_CHANGED
const NotificationWmSizeChanged Object.Notification = 1008 //gd:Node.NOTIFICATION_WM_SIZE_CHANGED
const NotificationWmWindowFocusIn Object.Notification = 1004 //gd:Node.NOTIFICATION_WM_WINDOW_FOCUS_IN
const NotificationWmWindowFocusOut Object.Notification = 1005 //gd:Node.NOTIFICATION_WM_WINDOW_FOCUS_OUT
Variables ¶
This section is empty.
Functions ¶
func GetOrphanNodeIds ¶
func GetOrphanNodeIds() []int
Returns object IDs of all orphan nodes (nodes outside the graphics.gd/classdb/SceneTree). Used for debugging.
Note: GetOrphanNodeIds only works in debug builds. When called in a project exported in release mode, GetOrphanNodeIds will return an empty array.
func PrintOrphanNodes ¶
func PrintOrphanNodes()
Prints all orphan nodes (nodes outside the graphics.gd/classdb/SceneTree). Useful for debugging.
Note: This method only works in debug builds. Does nothing in a project exported in release mode.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type AutoTranslateMode ¶
type AutoTranslateMode int //gd:Node.AutoTranslateMode
const ( // Inherits [Instance.AutoTranslateMode] from the node's parent. This is the default for any newly created node. AutoTranslateModeInherit AutoTranslateMode = 0 // Always automatically translate. This is the inverse of [AutoTranslateModeDisabled], and the default for the root node. AutoTranslateModeAlways AutoTranslateMode = 1 // Never automatically translate. This is the inverse of [AutoTranslateModeAlways]. // // String parsing for POT generation will be skipped for this node and children that are set to [AutoTranslateModeInherit]. AutoTranslateModeDisabled AutoTranslateMode = 2 )
type DuplicateFlags ¶
type DuplicateFlags int //gd:Node.DuplicateFlags
const ( // Duplicate the node's signal connections that are connected with the [Object.ConnectPersist] flag. DuplicateSignals DuplicateFlags = 1 // Duplicate the node's groups. DuplicateGroups DuplicateFlags = 2 // Duplicate the node's script (also overriding the duplicated children's scripts, if combined with [DuplicateUseInstantiation]). DuplicateScripts DuplicateFlags = 4 // Duplicate using [graphics.gd/classdb/PackedScene.Instance.Instantiate]. If the node comes from a scene saved on disk, reuses [graphics.gd/classdb/PackedScene.Instance.Instantiate] as the base for the duplicated node and its children. DuplicateUseInstantiation DuplicateFlags = 8 )
type Expanded ¶
func (Expanded) AddChild ¶
func (self Expanded) AddChild(node Instance, force_readable_name bool, internal_ InternalMode)
Adds a child 'node'. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
If 'force_readable_name' is true, improves the readability of the added 'node'. If not named, the 'node' is renamed to its type, and if it shares Instance.Name with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to false, which assigns a dummy name featuring @ in both situations.
If 'internal' is different than InternalModeDisabled, the child will be added as internal node. These nodes are ignored by methods like Instance.GetChildren, unless their parameter include_internal is true. It also prevents these nodes being duplicated with their parent. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. graphics.gd/classdb/ColorPicker.
Note: If 'node' already has a parent, this method will fail. Use Instance.RemoveChild first to remove 'node' from its current parent. For example:
If you need the child node to be added below a specific node in the list of children, use Instance.AddSibling instead of this method.
Note: If you want a child to be persisted to a graphics.gd/classdb/PackedScene, you must set Instance.Owner in addition to calling Instance.AddChild. This is typically relevant for tool scripts and editor plugins. If Instance.AddChild is called without setting Instance.Owner, the newly added graphics.gd/classdb/Node will not be visible in the scene tree, though it will be visible in the 2D/3D view.
func (Expanded) AddSibling ¶
Adds a 'sibling' node to this node's parent, and moves the added sibling right below this node.
If 'force_readable_name' is true, improves the readability of the added 'sibling'. If not named, the 'sibling' is renamed to its type, and if it shares Instance.Name with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to false, which assigns a dummy name featuring @ in both situations.
Use Instance.AddChild instead of this method if you don't need the child node to be added below a specific node in the list of children.
Note: If this node is internal, the added sibling will be internal too (see Instance.AddChild's internal parameter).
func (Expanded) AddToGroup ¶
Adds the node to the 'group'. Groups can be helpful to organize a subset of nodes, for example "enemies" or "collectables". See notes in the description, and the group methods in graphics.gd/classdb/SceneTree.
If 'persistent' is true, the group will be stored when saved inside a graphics.gd/classdb/PackedScene. All groups created and displayed in the Node dock are persistent.
Note: To improve performance, the order of group names is not guaranteed and may vary between project runs. Therefore, do not rely on the group order.
Note: graphics.gd/classdb/SceneTree's group methods will not work on this node if not inside the tree (see Instance.IsInsideTree).
func (Expanded) Atr ¶
Translates a 'message', using the translation catalogs configured in the Project Settings. Further 'context' can be specified to help with the translation. Note that most graphics.gd/classdb/Control nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text.
This method works the same as graphics.gd/classdb/Object.Instance.Tr, with the addition of respecting the Instance.AutoTranslateMode state.
If graphics.gd/classdb/Object.Instance.CanTranslateMessages is false, or no translation is available, this method returns the 'message' without changes. See graphics.gd/classdb/Object.Instance.SetMessageTranslation.
For detailed examples, see Internationalizing games.
func (Expanded) AtrN ¶
Translates a 'message' or 'plural_message', using the translation catalogs configured in the Project Settings. Further 'context' can be specified to help with the translation.
This method works the same as graphics.gd/classdb/Object.Instance.TrN, with the addition of respecting the Instance.AutoTranslateMode state.
If graphics.gd/classdb/Object.Instance.CanTranslateMessages is false, or no translation is available, this method returns 'message' or 'plural_message', without changes. See graphics.gd/classdb/Object.Instance.SetMessageTranslation.
The 'n' is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language.
For detailed examples, see Localization using gettext.
Note: Negative and [Float.X] numbers may not properly apply to some countable subjects. It's recommended to handle these cases with Instance.Atr.
func (Expanded) Duplicate ¶
Duplicates the node, returning a new node with all of its properties, signals, groups, and children copied from the original. The behavior can be tweaked through the 'flags' (see DuplicateFlags). Internal nodes are not duplicated.
Note: For nodes with a graphics.gd/classdb/Script attached, if graphics.gd/classdb/Object.Instance.Init has been defined with required parameters, the duplicated node will not have a graphics.gd/classdb/Script.
func (Expanded) FindChild ¶
Finds the first descendant of this node whose Instance.Name matches 'pattern', returning null if no match is found. The matching is done against node names, not their paths, through graphics.gd/classdb/String.Instance.Match. As such, it is case-sensitive, "*" matches zero or more characters, and "?" matches any single character.
If 'recursive' is false, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see internal parameter in Instance.AddChild).
If 'owned' is true, only descendants with a valid Instance.Owner node are checked.
Note: This method can be very slow. Consider storing a reference to the found node in a variable. Alternatively, use Instance.GetNode with unique names (see Instance.UniqueNameInOwner).
Note: To find all descendant nodes matching a pattern or a class type, see Instance.FindChildren.
func (Expanded) FindChildren ¶
func (self Expanded) FindChildren(pattern string, atype string, recursive bool, owned bool) []Instance
Finds all descendants of this node whose names match 'pattern', returning an empty slice if no match is found. The matching is done against node names, not their paths, through graphics.gd/classdb/String.Instance.Match. As such, it is case-sensitive, "*" matches zero or more characters, and "?" matches any single character.
If 'type' is not empty, only ancestors inheriting from 'type' are included (see graphics.gd/classdb/Object.Instance.IsClass).
If 'recursive' is false, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see internal parameter in Instance.AddChild).
If 'owned' is true, only descendants with a valid Instance.Owner node are checked.
Note: This method can be very slow. Consider storing references to the found nodes in a variable.
Note: To find a single descendant node matching a pattern, see Instance.FindChild.
func (Expanded) GetChild ¶
Fetches a child node by its index. Each child node has an index relative to its siblings (see Instance.GetIndex). The first child is at index 0. Negative values can also be used to start from the end of the list. This method can be used in combination with Instance.GetChildCount to iterate over this node's children. If no child exists at the given index, this method returns null and an error is generated.
If 'include_internal' is false, internal children are ignored (see Instance.AddChild's internal parameter).
Note: To fetch a node by node path, use Instance.GetNode.
func (Expanded) GetChildCount ¶
Returns the number of children of this node.
If 'include_internal' is false, internal children are not counted (see Instance.AddChild's internal parameter).
func (Expanded) GetChildren ¶
Returns all children of this node inside an slice.
If 'include_internal' is false, excludes internal children from the returned array (see Instance.AddChild's internal parameter).
func (Expanded) GetIndex ¶
Returns this node's order among its siblings. The first node's index is 0. See also Instance.GetChild.
If 'include_internal' is false, returns the index ignoring internal children. The first, non-internal child will have an index of 0 (see Instance.AddChild's internal parameter).
func (Expanded) GetPathTo ¶
Returns the relative node path from this node to the specified 'node'. Both nodes must be in the same graphics.gd/classdb/SceneTree or scene hierarchy, otherwise this method fails and returns an empty node path.
If 'use_unique_path' is true, returns the shortest path accounting for this node's unique name (see Instance.UniqueNameInOwner).
Note: If you get a relative path which starts from a unique node, the path may be longer than a normal relative path, due to the addition of the unique node's name.
func (Expanded) PropagateCall ¶
Calls the given 'method' name, passing 'args' as arguments, on this node and all of its children, recursively.
If 'parent_first' is true, the method is called on this node first, then on all of its children. If false, the children's methods are called first.
func (Expanded) Reparent ¶
Changes the parent of this graphics.gd/classdb/Node to the 'new_parent'. The node needs to already have a parent. The node's Instance.Owner is preserved if its owner is still reachable from the new location (i.e., the node is still a descendant of the new parent after the operation).
If 'keep_global_transform' is true, the node's global transform will be preserved if supported. graphics.gd/classdb/Node2D, graphics.gd/classdb/Node3D and graphics.gd/classdb/Control support this argument (but graphics.gd/classdb/Control keeps only position).
func (Expanded) ReplaceBy ¶
Replaces this node by the given 'node'. All children of this node are moved to 'node'.
If 'keep_groups' is true, the 'node' is added to the same groups that the replaced node is in (see Instance.AddToGroup).
Warning: The replaced node is removed from the tree, but it is not deleted. To prevent memory leaks, store a reference to the node in a variable, or use graphics.gd/classdb/Object.Instance.Free.
func (Expanded) SetMultiplayerAuthority ¶
Sets the node's multiplayer authority to the peer with the given peer 'id'. The multiplayer authority is the peer that has authority over the node on the network. Defaults to peer ID 1 (the server). Useful in conjunction with Instance.RpcConfig and the graphics.gd/classdb/MultiplayerAPI.
If 'recursive' is true, the given peer is recursively set as the authority for all children of this node.
Warning: This does not automatically replicate the new authority to other peers. It is the developer's responsibility to do so. You may replicate the new authority's information using graphics.gd/classdb/MultiplayerSpawner.Instance.SpawnFunction, an RPC, or a graphics.gd/classdb/MultiplayerSynchronizer. Furthermore, the parent's authority does not propagate to newly added children.
type Extension ¶
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]See Interface for methods that can be overridden by T.
type 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.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func ResourceLocalScene ¶
If [member resource_local_to_scene] is set to [code]true[/code] and the resource has been loaded from a [PackedScene] instantiation, returns the root [Node] of the scene where this resource is used. Otherwise, returns [code]null[/code].
func (Instance) AddChild ¶
Adds a child 'node'. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
If 'force_readable_name' is true, improves the readability of the added 'node'. If not named, the 'node' is renamed to its type, and if it shares Instance.Name with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to false, which assigns a dummy name featuring @ in both situations.
If 'internal' is different than InternalModeDisabled, the child will be added as internal node. These nodes are ignored by methods like Instance.GetChildren, unless their parameter include_internal is true. It also prevents these nodes being duplicated with their parent. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. graphics.gd/classdb/ColorPicker.
Note: If 'node' already has a parent, this method will fail. Use Instance.RemoveChild first to remove 'node' from its current parent. For example:
If you need the child node to be added below a specific node in the list of children, use Instance.AddSibling instead of this method.
Note: If you want a child to be persisted to a graphics.gd/classdb/PackedScene, you must set Instance.Owner in addition to calling Instance.AddChild. This is typically relevant for tool scripts and editor plugins. If Instance.AddChild is called without setting Instance.Owner, the newly added graphics.gd/classdb/Node will not be visible in the scene tree, though it will be visible in the 2D/3D view.
func (Instance) AddSibling ¶
Adds a 'sibling' node to this node's parent, and moves the added sibling right below this node.
If 'force_readable_name' is true, improves the readability of the added 'sibling'. If not named, the 'sibling' is renamed to its type, and if it shares Instance.Name with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to false, which assigns a dummy name featuring @ in both situations.
Use Instance.AddChild instead of this method if you don't need the child node to be added below a specific node in the list of children.
Note: If this node is internal, the added sibling will be internal too (see Instance.AddChild's internal parameter).
func (Instance) AddToGroup ¶
Adds the node to the 'group'. Groups can be helpful to organize a subset of nodes, for example "enemies" or "collectables". See notes in the description, and the group methods in graphics.gd/classdb/SceneTree.
If 'persistent' is true, the group will be stored when saved inside a graphics.gd/classdb/PackedScene. All groups created and displayed in the Node dock are persistent.
Note: To improve performance, the order of group names is not guaranteed and may vary between project runs. Therefore, do not rely on the group order.
Note: graphics.gd/classdb/SceneTree's group methods will not work on this node if not inside the tree (see Instance.IsInsideTree).
func (Instance) Atr ¶
Translates a 'message', using the translation catalogs configured in the Project Settings. Further 'context' can be specified to help with the translation. Note that most graphics.gd/classdb/Control nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text.
This method works the same as graphics.gd/classdb/Object.Instance.Tr, with the addition of respecting the Instance.AutoTranslateMode state.
If graphics.gd/classdb/Object.Instance.CanTranslateMessages is false, or no translation is available, this method returns the 'message' without changes. See graphics.gd/classdb/Object.Instance.SetMessageTranslation.
For detailed examples, see Internationalizing games.
func (Instance) AtrN ¶
Translates a 'message' or 'plural_message', using the translation catalogs configured in the Project Settings. Further 'context' can be specified to help with the translation.
This method works the same as graphics.gd/classdb/Object.Instance.TrN, with the addition of respecting the Instance.AutoTranslateMode state.
If graphics.gd/classdb/Object.Instance.CanTranslateMessages is false, or no translation is available, this method returns 'message' or 'plural_message', without changes. See graphics.gd/classdb/Object.Instance.SetMessageTranslation.
The 'n' is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language.
For detailed examples, see Localization using gettext.
Note: Negative and [Float.X] numbers may not properly apply to some countable subjects. It's recommended to handle these cases with Instance.Atr.
func (Instance) AutoTranslateMode ¶
func (self Instance) AutoTranslateMode() AutoTranslateMode
func (Instance) BindNode ¶
Binds this [Tween] with the given [param node]. [Tween]s are processed directly by the [SceneTree], so they run independently of the animated nodes. When you bind a [Node] with the [Tween], the [Tween] will halt the animation when the object is not inside tree and the [Tween] will be automatically killed when the bound object is freed. Also [constant TWEEN_PAUSE_BOUND] will make the pausing behavior dependent on the bound node. For a shorter way to create and bind a [Tween], you can use [method Node.create_tween].
func (Instance) CallDeferredThreadGroup ¶
This function is similar to graphics.gd/classdb/Object.Instance.CallDeferred except that the call will take place when the node thread group is processed. If the node thread group processes in sub-threads, then the call will be done on that thread, right before NotificationProcess or NotificationPhysicsProcess, the [Interface.Process] or [Interface.PhysicsProcess] or their internal versions are called.
func (Instance) CallThreadSafe ¶
This function ensures that the calling of this function will succeed, no matter whether it's being done from a thread or not. If called from a thread that is not allowed to call the function, the call will become deferred. Otherwise, the call will go through directly.
func (Instance) CanAutoTranslate ¶
Returns true if this node can automatically translate messages depending on the current locale. See Instance.AutoTranslateMode, Instance.Atr, and Instance.AtrN.
func (Instance) CanProcess ¶
Returns true if the node can receive processing notifications and input callbacks (NotificationProcess, [Interface.Input], etc.) from the graphics.gd/classdb/SceneTree and graphics.gd/classdb/Viewport. The returned value depends on Instance.ProcessMode:
- If set to ProcessModePausable, returns true when the game is processing, i.e. graphics.gd/classdb/SceneTree.Instance.Paused is false;
- If set to ProcessModeWhenPaused, returns true when the game is paused, i.e. graphics.gd/classdb/SceneTree.Instance.Paused is true;
- If set to ProcessModeAlways, always returns true;
- If set to ProcessModeDisabled, always returns false;
- If set to ProcessModeInherit, use the parent node's Instance.ProcessMode to determine the result.
If the node is not inside the tree, returns false no matter the value of Instance.ProcessMode.
func (Instance) CreateTween ¶
Creates a new graphics.gd/classdb/Tween and binds it to this node.
This is the equivalent of doing:
The Tween will start automatically on the next process frame or physics frame (depending on [Tween.TweenProcessMode]). See graphics.gd/classdb/Tween.Instance.BindNode for more info on Tweens bound to nodes.
Note: The method can still be used when the node is not inside graphics.gd/classdb/SceneTree. It can fail in an unlikely case of using a custom graphics.gd/classdb/MainLoop.
func (Instance) Duplicate ¶
Duplicates the node, returning a new node with all of its properties, signals, groups, and children copied from the original. The behavior can be tweaked through the 'flags' (see DuplicateFlags). Internal nodes are not duplicated.
Note: For nodes with a graphics.gd/classdb/Script attached, if graphics.gd/classdb/Object.Instance.Init has been defined with required parameters, the duplicated node will not have a graphics.gd/classdb/Script.
func (Instance) EditorDescription ¶
func (Instance) FindChild ¶
Finds the first descendant of this node whose Instance.Name matches 'pattern', returning null if no match is found. The matching is done against node names, not their paths, through graphics.gd/classdb/String.Instance.Match. As such, it is case-sensitive, "*" matches zero or more characters, and "?" matches any single character.
If 'recursive' is false, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see internal parameter in Instance.AddChild).
If 'owned' is true, only descendants with a valid Instance.Owner node are checked.
Note: This method can be very slow. Consider storing a reference to the found node in a variable. Alternatively, use Instance.GetNode with unique names (see Instance.UniqueNameInOwner).
Note: To find all descendant nodes matching a pattern or a class type, see Instance.FindChildren.
func (Instance) FindChildren ¶
Finds all descendants of this node whose names match 'pattern', returning an empty slice if no match is found. The matching is done against node names, not their paths, through graphics.gd/classdb/String.Instance.Match. As such, it is case-sensitive, "*" matches zero or more characters, and "?" matches any single character.
If 'type' is not empty, only ancestors inheriting from 'type' are included (see graphics.gd/classdb/Object.Instance.IsClass).
If 'recursive' is false, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see internal parameter in Instance.AddChild).
If 'owned' is true, only descendants with a valid Instance.Owner node are checked.
Note: This method can be very slow. Consider storing references to the found nodes in a variable.
Note: To find a single descendant node matching a pattern, see Instance.FindChild.
func (Instance) FindParent ¶
Finds the first ancestor of this node whose Instance.Name matches 'pattern', returning null if no match is found. The matching is done through graphics.gd/classdb/String.Instance.Match. As such, it is case-sensitive, "*" matches zero or more characters, and "?" matches any single character. See also Instance.FindChild and Instance.FindChildren.
Note: As this method walks upwards in the scene tree, it can be slow in large, deeply nested nodes. Consider storing a reference to the found node in a variable. Alternatively, use Instance.GetNode with unique names (see Instance.UniqueNameInOwner).
func (Instance) GetAccessibilityElement ¶
func (self Instance) GetAccessibilityElement() RID.AccessibilityElement
Returns main accessibility element RID.
Note: This method should be called only during accessibility information updates (NotificationAccessibilityUpdate).
func (Instance) GetChild ¶
Fetches a child node by its index. Each child node has an index relative to its siblings (see Instance.GetIndex). The first child is at index 0. Negative values can also be used to start from the end of the list. This method can be used in combination with Instance.GetChildCount to iterate over this node's children. If no child exists at the given index, this method returns null and an error is generated.
If 'include_internal' is false, internal children are ignored (see Instance.AddChild's internal parameter).
Note: To fetch a node by node path, use Instance.GetNode.
func (Instance) GetChildCount ¶
Returns the number of children of this node.
If 'include_internal' is false, internal children are not counted (see Instance.AddChild's internal parameter).
func (Instance) GetChildren ¶
Returns all children of this node inside an slice.
If 'include_internal' is false, excludes internal children from the returned array (see Instance.AddChild's internal parameter).
func (Instance) GetGroups ¶
Returns an slice of group names that the node has been added to.
Note: To improve performance, the order of group names is not guaranteed and may vary between project runs. Therefore, do not rely on the group order.
Note: This method may also return some group names starting with an underscore (_). These are internally used by the engine. To avoid conflicts, do not use custom groups starting with underscores. To exclude internal groups, see the following code snippet:
func (Instance) GetIndex ¶
Returns this node's order among its siblings. The first node's index is 0. See also Instance.GetChild.
If 'include_internal' is false, returns the index ignoring internal children. The first, non-internal child will have an index of 0 (see Instance.AddChild's internal parameter).
func (Instance) GetMultiplayerAuthority ¶
Returns the peer ID of the multiplayer authority for this node. See Instance.SetMultiplayerAuthority.
func (Instance) GetNode ¶
Fetches a node. The node path can either be a relative path (from this node), or an absolute path (from the graphics.gd/classdb/SceneTree.Instance.Root) to a node. If 'path' does not point to a valid node, generates an error and returns null. Attempts to access methods on the return value will result in an "Attempt to call <method> on a null instance." error.
Note: Fetching by absolute path only works when the node is inside the scene tree (see Instance.IsInsideTree).
Example: Assume this method is called from the Character node, inside the following tree:
The following calls will return a valid node:
func (Instance) GetNodeAndResource ¶
Fetches a node and its most nested resource as specified by the node path's subname. Returns an slice of size 3 where:
- Element 0 is the graphics.gd/classdb/Node, or null if not found;
- Element 1 is the subname's last nested graphics.gd/classdb/Resource, or null if not found;
- Element 2 is the remaining node path, referring to an existing, non-graphics.gd/classdb/Resource property (see graphics.gd/classdb/Object.Instance.GetIndexed).
Example: Assume that the child's graphics.gd/classdb/Sprite2D.Instance.Texture has been assigned an graphics.gd/classdb/AtlasTexture:
func (Instance) GetNodeOrNull ¶
Fetches a node by node path. Similar to Instance.GetNode, but does not generate an error if 'path' does not point to a valid node.
func (Instance) GetNodeRpcConfig ¶
Returns a data structure mapping method names to their RPC configuration defined for this node using Instance.RpcConfig.
Note: This method only returns the RPC configuration assigned via Instance.RpcConfig. See graphics.gd/classdb/Script.Instance.GetRpcConfig to retrieve the RPCs defined by the graphics.gd/classdb/Script.
func (Instance) GetParent ¶
Returns this node's parent node, or null if the node doesn't have a parent.
func (Instance) GetPath ¶
Returns the node's absolute path, relative to the graphics.gd/classdb/SceneTree.Instance.Root. If the node is not inside the scene tree, this method fails and returns an empty node path.
func (Instance) GetPathTo ¶
Returns the relative node path from this node to the specified 'node'. Both nodes must be in the same graphics.gd/classdb/SceneTree or scene hierarchy, otherwise this method fails and returns an empty node path.
If 'use_unique_path' is true, returns the shortest path accounting for this node's unique name (see Instance.UniqueNameInOwner).
Note: If you get a relative path which starts from a unique node, the path may be longer than a normal relative path, due to the addition of the unique node's name.
func (Instance) GetPhysicsProcessDeltaTime ¶
Returns the time elapsed (in seconds) since the last physics callback. This value is identical to [Interface.PhysicsProcess]'s delta parameter, and is often consistent at run-time, unless graphics.gd/classdb/Engine.PhysicsTicksPerSecond is changed. See also NotificationPhysicsProcess.
Note: The returned value will be larger than expected if running at a framerate lower than graphics.gd/classdb/Engine.PhysicsTicksPerSecond / graphics.gd/classdb/Engine.MaxPhysicsStepsPerFrame FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [Interface.Process] and [Interface.PhysicsProcess]. As a result, avoid using delta for time measurements in real-world seconds. Use the graphics.gd/classdb/Time singleton's methods for this purpose instead, such as graphics.gd/classdb/Time.GetTicksUsec.
func (Instance) GetProcessDeltaTime ¶
Returns the time elapsed (in seconds) since the last process callback. This value is identical to [Interface.Process]'s delta parameter, and may vary from frame to frame. See also NotificationProcess.
Note: The returned value will be larger than expected if running at a framerate lower than graphics.gd/classdb/Engine.PhysicsTicksPerSecond / graphics.gd/classdb/Engine.MaxPhysicsStepsPerFrame FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [Interface.Process] and [Interface.PhysicsProcess]. As a result, avoid using delta for time measurements in real-world seconds. Use the graphics.gd/classdb/Time singleton's methods for this purpose instead, such as graphics.gd/classdb/Time.GetTicksUsec.
func (Instance) GetSceneInstanceLoadPlaceholder ¶
Returns true if this node is an instance load placeholder. See graphics.gd/classdb/InstancePlaceholder and Instance.SetSceneInstanceLoadPlaceholder.
func (Instance) GetTreeString ¶
Returns the tree as a string. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the Instance.GetNode function. It also can be used in game UI/UX.
May print, for example:
func (Instance) GetTreeStringPretty ¶
Similar to Instance.GetTreeString, this returns the tree as a string. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees.
May print, for example:
func (Instance) HasNode ¶
Returns true if the 'path' points to a valid node. See also Instance.GetNode.
func (Instance) HasNodeAndResource ¶
Returns true if 'path' points to a valid node and its subnames point to a valid graphics.gd/classdb/Resource, e.g. Area2D/CollisionShape2D:shape. Properties that are not graphics.gd/classdb/Resource types (such as nodes or other any types) are not considered. See also Instance.GetNodeAndResource.
func (Instance) IsAncestorOf ¶
Returns true if the given 'node' is a direct or indirect child of this node.
func (Instance) IsDisplayedFolded ¶
Returns true if the node is folded (collapsed) in the Scene dock. This method is intended to be used in editor plugins and tools. See also Instance.SetDisplayFolded.
func (Instance) IsEditableInstance ¶
Returns true if 'node' has editable children enabled relative to this node. This method is intended to be used in editor plugins and tools. See also Instance.SetEditableInstance.
func (Instance) IsGreaterThan ¶
Returns true if the given 'node' occurs later in the scene hierarchy than this node. A node occurring later is usually processed last.
func (Instance) IsInGroup ¶
Returns true if this node has been added to the given 'group'. See Instance.AddToGroup and Instance.RemoveFromGroup. See also notes in the description, and the graphics.gd/classdb/SceneTree's group methods.
func (Instance) IsInsideTree ¶
Returns true if this node is currently inside a graphics.gd/classdb/SceneTree. See also [Instance.GetTree].
func (Instance) IsMultiplayerAuthority ¶
Returns true if the local system is the multiplayer authority of this node.
func (Instance) IsNodeReady ¶
Returns true if the node is ready, i.e. it's inside scene tree and all its children are initialized.
Instance.RequestReady resets it back to false.
func (Instance) IsPartOfEditedScene ¶
Returns true if the node is part of the scene currently opened in the editor.
func (Instance) IsPhysicsInterpolated ¶
Returns true if physics interpolation is enabled for this node (see Instance.PhysicsInterpolationMode).
Note: Interpolation will only be active if both the flag is set and physics interpolation is enabled within the graphics.gd/classdb/SceneTree. This can be tested using Instance.IsPhysicsInterpolatedAndEnabled.
func (Instance) IsPhysicsInterpolatedAndEnabled ¶
Returns true if physics interpolation is enabled (see Instance.PhysicsInterpolationMode) and enabled in the graphics.gd/classdb/SceneTree.
This is a convenience version of Instance.IsPhysicsInterpolated that also checks whether physics interpolation is enabled globally.
See graphics.gd/classdb/SceneTree.Instance.PhysicsInterpolation and graphics.gd/classdb/ProjectSettings "physics/common/physics_interpolation".
func (Instance) IsPhysicsProcessing ¶
Returns true if physics processing is enabled (see Instance.SetPhysicsProcess).
func (Instance) IsPhysicsProcessingInternal ¶
Returns true if internal physics processing is enabled (see Instance.SetPhysicsProcessInternal).
func (Instance) IsProcessing ¶
Returns true if processing is enabled (see Instance.SetProcess).
func (Instance) IsProcessingInput ¶
Returns true if the node is processing input (see Instance.SetProcessInput).
func (Instance) IsProcessingInternal ¶
Returns true if internal processing is enabled (see Instance.SetProcessInternal).
func (Instance) IsProcessingShortcutInput ¶
Returns true if the node is processing shortcuts (see Instance.SetProcessShortcutInput).
func (Instance) IsProcessingUnhandledInput ¶
Returns true if the node is processing unhandled input (see Instance.SetProcessUnhandledInput).
func (Instance) IsProcessingUnhandledKeyInput ¶
Returns true if the node is processing unhandled key input (see Instance.SetProcessUnhandledKeyInput).
func (Instance) IsQueuedForDeletion ¶
IsQueuedForDeletion returns true if the Instance.QueueFree method was called for the object.
func (Instance) MoveChild ¶
Moves 'child_node' to the given index. A node's index is the order among its siblings. If 'to_index' is negative, the index is counted from the end of the list. See also Instance.GetChild and Instance.GetIndex.
Note: The processing order of several engine callbacks ([Interface.Ready], [Interface.Process], etc.) and notifications sent through Instance.PropagateNotification is affected by tree order. graphics.gd/classdb/CanvasItem nodes are also rendered in tree order. See also Instance.ProcessPriority.
func (Instance) Multiplayer ¶
func (self Instance) Multiplayer() MultiplayerAPI.Instance
func (Instance) NotifyDeferredThreadGroup ¶
Similar to Instance.CallDeferredThreadGroup, but for notifications.
func (Instance) NotifyThreadSafe ¶
Similar to Instance.CallThreadSafe, but for notifications.
func (Instance) OnChildEnteredTree ¶
func (Instance) OnChildExitingTree ¶
func (Instance) OnChildOrderChanged ¶
func (Instance) OnEditorDescriptionChanged ¶
func (Instance) OnEditorStateChanged ¶
func (Instance) OnReplacingBy ¶
func (Instance) OnTreeEntered ¶
func (Instance) OnTreeExited ¶
func (Instance) OnTreeExiting ¶
func (Instance) PhysicsInterpolationMode ¶
func (self Instance) PhysicsInterpolationMode() PhysicsInterpolationMode
func (Instance) PrintTree ¶
func (self Instance) PrintTree()
Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs node paths relative to this node, and is good for copy/pasting into Instance.GetNode. See also Instance.PrintTreePretty.
May print, for example:
func (Instance) PrintTreePretty ¶
func (self Instance) PrintTreePretty()
Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to Instance.PrintTree, but the graphical representation looks like what is displayed in the editor's Scene dock. It is useful for inspecting larger trees.
May print, for example:
func (Instance) ProcessMode ¶
func (self Instance) ProcessMode() ProcessMode
func (Instance) ProcessPhysicsPriority ¶
func (Instance) ProcessPriority ¶
func (Instance) ProcessThreadGroup ¶
func (self Instance) ProcessThreadGroup() ProcessThreadGroup
func (Instance) ProcessThreadGroupOrder ¶
func (Instance) ProcessThreadMessages ¶
func (self Instance) ProcessThreadMessages() ProcessThreadMessages
func (Instance) PropagateCall ¶
Calls the given 'method' name, passing 'args' as arguments, on this node and all of its children, recursively.
If 'parent_first' is true, the method is called on this node first, then on all of its children. If false, the children's methods are called first.
func (Instance) PropagateNotification ¶
Calls graphics.gd/classdb/Object.Instance.Notification with 'what' on this node and all of its children, recursively.
func (Instance) QueueAccessibilityUpdate ¶
func (self Instance) QueueAccessibilityUpdate()
Queues an accessibility information update for this node.
func (Instance) QueueFree ¶
func (self Instance) QueueFree()
Queues this node to be deleted at the end of the current frame. When deleted, all of its children are deleted as well, and all references to the node and its children become invalid.
Unlike with graphics.gd/classdb/Object.Instance.Free, the node is not deleted instantly, and it can still be accessed before deletion. It is also safe to call Instance.QueueFree multiple times. Use graphics.gd/classdb/Object.Instance.IsQueuedForDeletion to check if the node will be deleted at the end of the frame.
Note: The node will only be freed after all other deferred calls are finished. Using this method is not always the same as calling graphics.gd/classdb/Object.Instance.Free through graphics.gd/classdb/Object.Instance.CallDeferred.
func (Instance) RemoveChild ¶
Removes a child 'node'. The 'node', along with its children, are not deleted. To delete a node, see Instance.QueueFree.
Note: When this node is inside the tree, this method sets the Instance.Owner of the removed 'node' (or its descendants) to null, if their Instance.Owner is no longer an ancestor (see Instance.IsAncestorOf).
func (Instance) RemoveFromGroup ¶
Removes the node from the given 'group'. Does nothing if the node is not in the 'group'. See also notes in the description, and the graphics.gd/classdb/SceneTree's group methods.
func (Instance) Reparent ¶
Changes the parent of this graphics.gd/classdb/Node to the 'new_parent'. The node needs to already have a parent. The node's Instance.Owner is preserved if its owner is still reachable from the new location (i.e., the node is still a descendant of the new parent after the operation).
If 'keep_global_transform' is true, the node's global transform will be preserved if supported. graphics.gd/classdb/Node2D, graphics.gd/classdb/Node3D and graphics.gd/classdb/Control support this argument (but graphics.gd/classdb/Control keeps only position).
func (Instance) ReplaceBy ¶
Replaces this node by the given 'node'. All children of this node are moved to 'node'.
If 'keep_groups' is true, the 'node' is added to the same groups that the replaced node is in (see Instance.AddToGroup).
Warning: The replaced node is removed from the tree, but it is not deleted. To prevent memory leaks, store a reference to the node in a variable, or use graphics.gd/classdb/Object.Instance.Free.
func (Instance) RequestReady ¶
func (self Instance) RequestReady()
Requests [Interface.Ready] to be called again the next time the node enters the tree. Does not immediately call [Interface.Ready].
Note: This method only affects the current node. If the node's children also need to request ready, this method needs to be called for each one of them. When the node and its children enter the tree again, the order of [Interface.Ready] callbacks will be the same as normal.
func (Instance) ResetPhysicsInterpolation ¶
func (self Instance) ResetPhysicsInterpolation()
When physics interpolation is active, moving a node to a radically different transform (such as placement within a level) can result in a visible glitch as the object is rendered moving from the old to new position over the physics tick.
That glitch can be prevented by calling this method, which temporarily disables interpolation until the physics tick is complete.
The notification NotificationResetPhysicsInterpolation will be received by the node and all children recursively.
Note: This function should be called after moving the node, rather than before.
func (Instance) Rpc ¶
Sends a remote procedure call request for the given 'method' to peers on the network (and locally), sending additional arguments to the method called by the RPC. The call request will only be received by nodes with the same node path, including the exact same Instance.Name. Behavior depends on the RPC configuration for the given 'method' (see Instance.RpcConfig and ). By default, methods are not exposed to RPCs.
May return [constant OK] if the call is successful, [constant ERR_INVALID_PARAMETER] if the arguments passed in the [param method] do not match, [constant ERR_UNCONFIGURED] if the node's [member multiplayer] cannot be fetched (such as when the node is not inside the tree), [constant ERR_CONNECTION_ERROR] if [member multiplayer]'s connection is not available.
[b]Note:[/b] You can only safely use RPCs on clients after you received the [signal MultiplayerAPI.connected_to_server] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [signal MultiplayerAPI.server_disconnected] or by checking ([code]get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED[/code]).). By default, methods are not exposed to RPCs.
May return [Ok] if the call is successful, [ErrInvalidParameter] if the arguments passed in the 'method' do not match, [ErrUnconfigured] if the node's Instance.Multiplayer cannot be fetched (such as when the node is not inside the tree), [ErrConnectionError] if Instance.Multiplayer's connection is not available.
Note: You can only safely use RPCs on clients after you received the [Instance.OnMultiplayerapi.ConnectedToServer] signal from the graphics.gd/classdb/MultiplayerAPI. You also need to keep track of the connection state, either by the graphics.gd/classdb/MultiplayerAPI signals like [Instance.OnMultiplayerapi.ServerDisconnected] or by checking (get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED).
func (Instance) RpcConfig ¶
Changes the RPC configuration for the given 'method'. 'config' should either be null to disable the feature (as by default), or a data structure containing the following entries:
- rpc_mode: see [MultiplayerAPI.RPCMode];
- transfer_mode: see [MultiplayerPeer.TransferMode];
- call_local: if true, the method will also be called locally;
- channel: an int representing the channel to send the RPC on.
Note: In GDScript, this method corresponds to the annotation, with various parameters passed ([code]@rpc(any)[/code], [code]@rpc(authority)[/code]...). See also the [url=https://docs.godotengine.org/tutorials/networking/high_level_multiplayer.html]high-level multiplayer[/url] tutorial. annotation, with various parameters passed (@rpc(any), @rpc(authority)...). See also the high-level multiplayer tutorial.
func (Instance) RpcId ¶
Sends a Instance.Rpc to a specific peer identified by 'peer_id' (see graphics.gd/classdb/MultiplayerPeer.Instance.SetTargetPeer).
May return [Ok] if the call is successful, [ErrInvalidParameter] if the arguments passed in the 'method' do not match, [ErrUnconfigured] if the node's Instance.Multiplayer cannot be fetched (such as when the node is not inside the tree), [ErrConnectionError] if Instance.Multiplayer's connection is not available.
func (Instance) SceneFilePath ¶
func (Instance) SetAutoTranslateMode ¶
func (self Instance) SetAutoTranslateMode(value AutoTranslateMode)
func (Instance) SetDeferredThreadGroup ¶
Similar to Instance.CallDeferredThreadGroup, but for setting properties.
func (Instance) SetDisplayFolded ¶
If set to true, the node appears folded in the Scene dock. As a result, all of its children are hidden. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also Instance.IsDisplayedFolded.
func (Instance) SetEditableInstance ¶
Set to true to allow all nodes owned by 'node' to be available, and editable, in the Scene dock, even if their Instance.Owner is not the scene root. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also Instance.IsEditableInstance.
func (Instance) SetEditorDescription ¶
func (Instance) SetMultiplayerAuthority ¶
Sets the node's multiplayer authority to the peer with the given peer 'id'. The multiplayer authority is the peer that has authority over the node on the network. Defaults to peer ID 1 (the server). Useful in conjunction with Instance.RpcConfig and the graphics.gd/classdb/MultiplayerAPI.
If 'recursive' is true, the given peer is recursively set as the authority for all children of this node.
Warning: This does not automatically replicate the new authority to other peers. It is the developer's responsibility to do so. You may replicate the new authority's information using graphics.gd/classdb/MultiplayerSpawner.Instance.SpawnFunction, an RPC, or a graphics.gd/classdb/MultiplayerSynchronizer. Furthermore, the parent's authority does not propagate to newly added children.
func (Instance) SetPhysicsInterpolationMode ¶
func (self Instance) SetPhysicsInterpolationMode(value PhysicsInterpolationMode)
func (Instance) SetPhysicsProcess ¶
If set to true, enables physics (fixed framerate) processing. When a node is being processed, it will receive a NotificationPhysicsProcess at a fixed (usually 60 FPS, see graphics.gd/classdb/Engine.PhysicsTicksPerSecond to change) interval (and the [Interface.PhysicsProcess] callback will be called if it exists).
Note: If [Interface.PhysicsProcess] is overridden, this will be automatically enabled before [Interface.Ready] is called.
func (Instance) SetPhysicsProcessInternal ¶
If set to true, enables internal physics for this node. Internal physics processing happens in isolation from the normal [Interface.PhysicsProcess] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting (Instance.SetPhysicsProcess).
Warning: Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing.
func (Instance) SetProcess ¶
If set to true, enables processing. When a node is being processed, it will receive a NotificationProcess on every drawn frame (and the [Interface.Process] callback will be called if it exists).
Note: If [Interface.Process] is overridden, this will be automatically enabled before [Interface.Ready] is called.
Note: This method only affects the [Interface.Process] callback, i.e. it has no effect on other callbacks like [Interface.PhysicsProcess]. If you want to disable all processing for the node, set Instance.ProcessMode to ProcessModeDisabled.
func (Instance) SetProcessInput ¶
If set to true, enables input processing.
Note: If [Interface.Input] is overridden, this will be automatically enabled before [Interface.Ready] is called. Input processing is also already enabled for GUI controls, such as graphics.gd/classdb/Button and graphics.gd/classdb/TextEdit.
func (Instance) SetProcessInternal ¶
If set to true, enables internal processing for this node. Internal processing happens in isolation from the normal [Interface.Process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting (Instance.SetProcess).
Warning: Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing.
func (Instance) SetProcessMode ¶
func (self Instance) SetProcessMode(value ProcessMode)
func (Instance) SetProcessPhysicsPriority ¶
func (Instance) SetProcessPriority ¶
func (Instance) SetProcessShortcutInput ¶
If set to true, enables shortcut processing for this node.
Note: If [Interface.ShortcutInput] is overridden, this will be automatically enabled before [Interface.Ready] is called.
func (Instance) SetProcessThreadGroup ¶
func (self Instance) SetProcessThreadGroup(value ProcessThreadGroup)
func (Instance) SetProcessThreadGroupOrder ¶
func (Instance) SetProcessThreadMessages ¶
func (self Instance) SetProcessThreadMessages(value ProcessThreadMessages)
func (Instance) SetProcessUnhandledInput ¶
If set to true, enables unhandled input processing. It enables the node to receive all input that was not previously handled (usually by a graphics.gd/classdb/Control).
Note: If [Interface.UnhandledInput] is overridden, this will be automatically enabled before [Interface.Ready] is called. Unhandled input processing is also already enabled for GUI controls, such as graphics.gd/classdb/Button and graphics.gd/classdb/TextEdit.
func (Instance) SetProcessUnhandledKeyInput ¶
If set to true, enables unhandled key input processing.
Note: If [Interface.UnhandledKeyInput] is overridden, this will be automatically enabled before [Interface.Ready] is called.
func (Instance) SetSceneFilePath ¶
func (Instance) SetSceneInstanceLoadPlaceholder ¶
If set to true, the node becomes an graphics.gd/classdb/InstancePlaceholder when packed and instantiated from a graphics.gd/classdb/PackedScene. See also Instance.GetSceneInstanceLoadPlaceholder.
func (Instance) SetThreadSafe ¶
Similar to Instance.CallThreadSafe, but for setting properties.
func (Instance) SetTranslationDomainInherited ¶
func (self Instance) SetTranslationDomainInherited()
Makes this node inherit the translation domain from its parent node. If this node has no parent, the main translation domain will be used.
This is the default behavior for all nodes. Calling graphics.gd/classdb/Object.Instance.SetTranslationDomain disables this behavior.
func (Instance) SetUniqueNameInOwner ¶
func (Instance) UniqueNameInOwner ¶
func (Instance) UpdateConfigurationWarnings ¶
func (self Instance) UpdateConfigurationWarnings()
Refreshes the warnings displayed for this node in the Scene dock. Use [Interface.GetConfigurationWarnings] to customize the warning messages to display.
type Interface ¶
type Interface interface { // Called on each idle frame, prior to rendering, and after physics ticks have been processed. 'delta' is the time between frames in seconds. // // It is only called if processing is enabled for this Node, which is done automatically if this method is overridden, and can be toggled with [Instance.SetProcess]. // // Processing happens in order of [Instance.ProcessPriority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal). // // Corresponds to the [NotificationProcess] notification in [graphics.gd/classdb/Object.Instance.Notification]. // // Note: This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). // // Note: When the engine is struggling and the frame rate is lowered, 'delta' will increase. When 'delta' is increased, it's capped at a maximum of [graphics.gd/classdb/Engine.TimeScale] * [graphics.gd/classdb/Engine.MaxPhysicsStepsPerFrame] / [graphics.gd/classdb/Engine.PhysicsTicksPerSecond]. As a result, accumulated 'delta' may not represent real world time. // // Note: When --fixed-fps is enabled or the engine is running in Movie Maker mode (see [graphics.gd/classdb/MovieWriter]), process 'delta' will always be the same for every frame, regardless of how much time the frame took to render. // // Note: Frame delta may be post-processed by [graphics.gd/classdb/OS.DeltaSmoothing] if this is enabled for the project. Process(delta Float.X) // Called once on each physics tick, and allows Nodes to synchronize their logic with physics ticks. 'delta' is the logical time between physics ticks in seconds and is equal to [graphics.gd/classdb/Engine.TimeScale] / [graphics.gd/classdb/Engine.PhysicsTicksPerSecond]. // // It is only called if physics processing is enabled for this Node, which is done automatically if this method is overridden, and can be toggled with [Instance.SetPhysicsProcess]. // // Processing happens in order of [Instance.ProcessPhysicsPriority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal). // // Corresponds to the [NotificationPhysicsProcess] notification in [graphics.gd/classdb/Object.Instance.Notification]. // // Note: This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). // // Note: Accumulated 'delta' may diverge from real world seconds. PhysicsProcess(delta Float.X) // Called when the node enters the [graphics.gd/classdb/SceneTree] (e.g. upon instantiating, scene changing, or after calling [Instance.AddChild] in a script). If the node has children, its [Interface.EnterTree] callback will be called first, and then that of the children. // // Corresponds to the [NotificationEnterTree] notification in [graphics.gd/classdb/Object.Instance.Notification]. EnterTree() // Called when the node is about to leave the [graphics.gd/classdb/SceneTree] (e.g. upon freeing, scene changing, or after calling [Instance.RemoveChild] in a script). If the node has children, its [Interface.ExitTree] callback will be called last, after all its children have left the tree. // // Corresponds to the [NotificationExitTree] notification in [graphics.gd/classdb/Object.Instance.Notification] and signal [Instance.OnTreeExiting]. To get notified when the node has already left the active tree, connect to the [Instance.OnTreeExited]. ExitTree() // Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their [Interface.Ready] callbacks get triggered first, and the parent node will receive the ready notification afterwards. // // Corresponds to the [NotificationReady] notification in [graphics.gd/classdb/Object.Instance.Notification]. See also the @onready annotation for variables. // // Usually used for initialization. For even earlier initialization, [graphics.gd/classdb/Object.Instance.Init] may be used. See also [Interface.EnterTree]. // // Note: This method may be called only once for each node. After removing a node from the scene tree and adding it again, [Interface.Ready] will not be called a second time. This can be bypassed by requesting another call with [Instance.RequestReady], which may be called anywhere before adding the node again. Ready() // The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a tool script. // // Returning an empty array produces no warnings. // // Call [Instance.UpdateConfigurationWarnings] when the warnings need to be updated for this node. // // // // @export var energy = 0: // // set(value): // // energy = value // // update_configuration_warnings() // // // // func _get_configuration_warnings(): // // if energy < 0: // // return ["Energy must be 0 or greater."] // // else: // // return [] // // GetConfigurationWarnings() []string // The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a tool script, and accessibility warnings are enabled in the editor settings. // // Returning an empty array produces no warnings. GetAccessibilityConfigurationWarnings() []string // Called when there is an input event. The input event propagates up through the node tree until a node consumes it. // // It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [Instance.SetProcessInput]. // // To consume the input event and stop it propagating further to other nodes, [graphics.gd/classdb/Viewport.Instance.SetInputAsHandled] can be called. // // For gameplay input, [Interface.UnhandledInput] and [Interface.UnhandledKeyInput] are usually a better fit as they allow the GUI to intercept the events first. // // Note: This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). Input(event InputEvent.Instance) // Called when an [graphics.gd/classdb/InputEventKey], [graphics.gd/classdb/InputEventShortcut], or [graphics.gd/classdb/InputEventJoypadButton] hasn't been consumed by [Interface.Input] or any GUI [graphics.gd/classdb/Control] item. It is called before [Interface.UnhandledKeyInput] and [Interface.UnhandledInput]. The input event propagates up through the node tree until a node consumes it. // // It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with [Instance.SetProcessShortcutInput]. // // To consume the input event and stop it propagating further to other nodes, [graphics.gd/classdb/Viewport.Instance.SetInputAsHandled] can be called. // // This method can be used to handle shortcuts. For generic GUI events, use [Interface.Input] instead. Gameplay events should usually be handled with either [Interface.UnhandledInput] or [Interface.UnhandledKeyInput]. // // Note: This method is only called if the node is present in the scene tree (i.e. if it's not orphan). ShortcutInput(event InputEvent.Instance) // Called when an [graphics.gd/classdb/InputEvent] hasn't been consumed by [Interface.Input] or any GUI [graphics.gd/classdb/Control] item. It is called after [Interface.ShortcutInput] and after [Interface.UnhandledKeyInput]. The input event propagates up through the node tree until a node consumes it. // // It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [Instance.SetProcessUnhandledInput]. // // To consume the input event and stop it propagating further to other nodes, [graphics.gd/classdb/Viewport.Instance.SetInputAsHandled] can be called. // // For gameplay input, this method is usually a better fit than [Interface.Input], as GUI events need a higher priority. For keyboard shortcuts, consider using [Interface.ShortcutInput] instead, as it is called before this method. Finally, to handle keyboard events, consider using [Interface.UnhandledKeyInput] for performance reasons. // // Note: This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). UnhandledInput(event InputEvent.Instance) // Called when an [graphics.gd/classdb/InputEventKey] hasn't been consumed by [Interface.Input] or any GUI [graphics.gd/classdb/Control] item. It is called after [Interface.ShortcutInput] but before [Interface.UnhandledInput]. The input event propagates up through the node tree until a node consumes it. // // It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [Instance.SetProcessUnhandledKeyInput]. // // To consume the input event and stop it propagating further to other nodes, [graphics.gd/classdb/Viewport.Instance.SetInputAsHandled] can be called. // // This method can be used to handle Unicode character input with Alt, Alt + Ctrl, and Alt + Shift modifiers, after shortcuts were handled. // // For gameplay input, this and [Interface.UnhandledInput] are usually a better fit than [Interface.Input], as GUI events should be handled first. This method also performs better than [Interface.UnhandledInput], since unrelated events such as [graphics.gd/classdb/InputEventMouseMotion] are automatically filtered. For shortcuts, consider using [Interface.ShortcutInput] instead. // // Note: This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). UnhandledKeyInput(event InputEvent.Instance) // Called during accessibility information updates to determine the currently focused sub-element, should return a sub-element RID or the value returned by [Instance.GetAccessibilityElement]. GetFocusedAccessibilityElement() RID.AccessibilityElement }
type InternalMode ¶
type InternalMode int //gd:Node.InternalMode
const ( // The node will not be internal. InternalModeDisabled InternalMode = 0 // The node will be placed at the beginning of the parent's children, before any non-internal sibling. InternalModeFront InternalMode = 1 // The node will be placed at the end of the parent's children, after any non-internal sibling. InternalModeBack InternalMode = 2 )
type PhysicsInterpolationMode ¶
type PhysicsInterpolationMode int //gd:Node.PhysicsInterpolationMode
const ( // Inherits [Instance.PhysicsInterpolationMode] from the node's parent. This is the default for any newly created node. PhysicsInterpolationModeInherit PhysicsInterpolationMode = 0 // Enables physics interpolation for this node and for children set to [PhysicsInterpolationModeInherit]. This is the default for the root node. PhysicsInterpolationModeOn PhysicsInterpolationMode = 1 // Disables physics interpolation for this node and for children set to [PhysicsInterpolationModeInherit]. PhysicsInterpolationModeOff PhysicsInterpolationMode = 2 )
type ProcessMode ¶
type ProcessMode int //gd:Node.ProcessMode
const ( // Inherits [Instance.ProcessMode] from the node's parent. This is the default for any newly created node. ProcessModeInherit ProcessMode = 0 // Stops processing when [graphics.gd/classdb/SceneTree.Instance.Paused] is true. This is the inverse of [ProcessModeWhenPaused], and the default for the root node. ProcessModePausable ProcessMode = 1 // Process only when [graphics.gd/classdb/SceneTree.Instance.Paused] is true. This is the inverse of [ProcessModePausable]. ProcessModeWhenPaused ProcessMode = 2 // Always process. Keeps processing, ignoring [graphics.gd/classdb/SceneTree.Instance.Paused]. This is the inverse of [ProcessModeDisabled]. ProcessModeAlways ProcessMode = 3 // Never process. Completely disables processing, ignoring [graphics.gd/classdb/SceneTree.Instance.Paused]. This is the inverse of [ProcessModeAlways]. ProcessModeDisabled ProcessMode = 4 )
type ProcessThreadGroup ¶
type ProcessThreadGroup int //gd:Node.ProcessThreadGroup
const ( // Process this node based on the thread group mode of the first parent (or grandparent) node that has a thread group mode that is not inherit. See [Instance.ProcessThreadGroup] for more information. ProcessThreadGroupInherit ProcessThreadGroup = 0 // Process this node (and child nodes set to inherit) on the main thread. See [Instance.ProcessThreadGroup] for more information. ProcessThreadGroupMainThread ProcessThreadGroup = 1 // Process this node (and child nodes set to inherit) on a sub-thread. See [Instance.ProcessThreadGroup] for more information. ProcessThreadGroupSubThread ProcessThreadGroup = 2 )
type ProcessThreadMessages ¶
type ProcessThreadMessages int //gd:Node.ProcessThreadMessages
const ( // Allows this node to process threaded messages created with [Instance.CallDeferredThreadGroup] right before [Instance.Process] is called. FlagProcessThreadMessages ProcessThreadMessages = 1 // Allows this node to process threaded messages created with [Instance.CallDeferredThreadGroup] right before [Instance.PhysicsProcess] is called. FlagProcessThreadMessagesPhysics ProcessThreadMessages = 2 // Allows this node to process threaded messages created with [Instance.CallDeferredThreadGroup] right before either [Instance.Process] or [Instance.PhysicsProcess] are called. FlagProcessThreadMessagesAll ProcessThreadMessages = 3 )