ProcessThreadMessages
Node.swift:100struct ProcessThreadMessages
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (176) members.
Types
enum AutoTranslateMode
enum DuplicateFlags
enum InternalMode
enum PhysicsInterpolationMode
enum ProcessMode
enum ProcessThreadGroup
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
class Signal4
Signal support.
Type members
static let notificationApplicationFocusIn: Int
Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance.
static let notificationApplicationFocusOut: Int
Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
static let notificationApplicationPaused: Int
Notification received from the OS when the application is paused.
static let notificationApplicationResumed: Int
Notification received from the OS when the application is resumed.
static let notificationChildOrderChanged: Int
Notification received when the list of children is changed. This happens when child nodes are added, moved or removed.
static let notificationCrash: Int
Notification received from Godot’s crash handler when the engine is about to crash.
static let notificationDisabled: Int
Notification received when the node is disabled. See .disabled.
static let notificationDragBegin: Int
Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one.
static let notificationDragEnd: Int
Notification received when a drag operation ends.
static let notificationEditorPostSave: Int
Notification received right after the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects.
static let notificationEditorPreSave: Int
Notification received right before the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects.
static let notificationEnabled: Int
Notification received when the node is enabled again after being disabled. See .disabled.
static let notificationEnterTree: Int
Notification received when the node enters a
SceneTree
. See_enterTree
.static let notificationExitTree: Int
Notification received when the node is about to exit a
SceneTree
. See_exitTree
.static let notificationInternalPhysicsProcess: Int
Notification received from the tree every physics frame when
isPhysicsProcessingInternal
returnstrue
.static let notificationInternalProcess: Int
Notification received from the tree every rendered frame when
isProcessingInternal
returnstrue
.static let notificationMovedInParent: Int
static let notificationOsImeUpdate: Int
Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
static let notificationOsMemoryWarning: Int
Notification received from the OS when the application is exceeding its allocated memory.
static let notificationParented: Int
Notification received when the node is set as a child of another node (see
addChild(node:forceReadableName:`internal`:)
andaddSibling(_:forceReadableName:)
).static let notificationPathRenamed: Int
Notification received when the node’s
name
or one of its ancestors’name
is changed. This notification is not received when the node is removed from theSceneTree
.static let notificationPaused: Int
Notification received when the node is paused. See
processMode
.static let notificationPhysicsProcess: Int
Notification received from the tree every physics frame when
isPhysicsProcessing
returnstrue
. See_physicsProcess(delta:)
.static let notificationPostEnterTree: Int
Notification received when the node enters the tree, just before
notificationReady
may be received. Unlike the latter, it is sent every time the node enters tree, not just once.static let notificationProcess: Int
Notification received from the tree every rendered frame when
isProcessing
returnstrue
. See_process(delta:)
.static let notificationReady: Int
Notification received when the node is ready. See
_ready
.static let notificationResetPhysicsInterpolation: Int
Notification received when
resetPhysicsInterpolation
is called on the node or its ancestors.static let notificationSceneInstantiated: Int
Notification received only by the newly instantiated scene root node, when
instantiate(editState:)
is completed.static let notificationTextServerChanged: Int
Notification received when the
TextServer
is changed.static let notificationTranslationChanged: Int
Notification received when translations may have changed. Can be triggered by the user changing the locale, changing
autoTranslateMode
or when the node enters the scene tree. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, liketr(message:context:)
.static let notificationUnparented: Int
Notification received when the parent node calls
removeChild(node:)
on this node.static let notificationUnpaused: Int
Notification received when the node is unpaused. See
processMode
.static let notificationVpMouseEnter: Int
Notification received when the mouse cursor enters the
Viewport
‘s visible area, that is not occluded behind otherControl
s orWindow
s, provided itsguiDisableInput
isfalse
and regardless if it’s currently focused or not.static let notificationVpMouseExit: Int
Notification received when the mouse cursor leaves the
Viewport
‘s visible area, that is not occluded behind otherControl
s orWindow
s, provided itsguiDisableInput
isfalse
and regardless if it’s currently focused or not.static let notificationWmAbout: Int
Notification received from the OS when a request for “About” information is sent.
static let notificationWmCloseRequest: Int
Notification received from the OS when a close request is sent (e.g. closing the window with a “Close” button or [kbd]Alt + F4[/kbd]).
static let notificationWmDpiChange: Int
Notification received from the OS when the screen’s dots per inch (DPI) scale is changed. Only implemented on macOS.
static let notificationWmGoBackRequest: Int
Notification received from the OS when a go back request is sent (e.g. pressing the “Back” button on Android).
static let notificationWmMouseEnter: Int
Notification received when the mouse enters the window.
static let notificationWmMouseExit: Int
Notification received when the mouse leaves the window.
static let notificationWmSizeChanged: Int
Notification received when the window is resized.
static let notificationWmWindowFocusIn: Int
Notification received from the OS when the node’s
Window
ancestor is focused. This may be a change of focus between two windows of the same engine instance, or from the OS desktop or a third-party application to a window of the game (in which casenotificationApplicationFocusIn
is also received).static let notificationWmWindowFocusOut: Int
Notification received from the OS when the node’s
Window
ancestor is defocused. This may be a change of focus between two windows of the same engine instance, or from a window of the game to the OS desktop or a third-party application (in which casenotificationApplicationFocusOut
is also received).static func printOrphanNodes(
) Prints all orphan nodes (nodes outside the
SceneTree
). Useful for debugging.class var godotClassName: StringName
Instance members
var autoTranslateMode: Node.AutoTranslateMode
Defines if any text should automatically change to its translated version depending on the current locale (for nodes such as
Label
,RichTextLabel
,Window
, etc.). Also decides if the node’s strings should be parsed for POT generation.var childEnteredTree: Signal1
Emitted when the child
node
enters theSceneTree
, usually because this node entered the tree (see [signal tree_entered]), oraddChild(node:forceReadableName:`internal`:)
has been called.var childExitingTree: Signal2
Emitted when the child
node
is about to exit theSceneTree
, usually because this node is exiting the tree (see [signal tree_exiting]), or because the childnode
is being removed or freed.var childOrderChanged: SimpleSignal
Emitted when the list of children is changed. This happens when child nodes are added, moved or removed.
var editorDescription: String
An optional description to the node. It will be displayed as a tooltip when hovering over the node in the editor’s Scene dock.
var editorDescriptionChanged: Signal4
Emitted when the node’s editor description field changed.
var multiplayer: MultiplayerAPI?
The
MultiplayerAPI
instance associated with this node. SeegetMultiplayer(forPath:)
.var name: StringName
The name of the node. This name must be unique among the siblings (other child nodes from the same parent). When set to an existing sibling’s name, the node is automatically renamed.
var owner: Node?
The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a
PackedScene
, all the nodes it owns are also saved with it.var physicsInterpolationMode: Node.PhysicsInterpolationMode
Allows enabling or disabling physics interpolation per node, offering a finer grain of control than turning physics interpolation on and off globally. See
ProjectSettings/physics/common/physicsInterpolation
andphysicsInterpolation
for the global setting.var processMode: Node.ProcessMode
The node’s processing behavior (see
ProcessMode
). To check if the node can process in its current mode, usecanProcess
.var processPhysicsPriority: Int32
Similar to
processPriority
but fornotificationPhysicsProcess
,_physicsProcess(delta:)
or the internal version.var processPriority: Int32
The node’s execution order of the process callbacks (
_process(delta:)
,_physicsProcess(delta:)
, and internal processing). Nodes whose priority value is lower call their process callbacks first, regardless of tree order.var processThreadGroup: Node.ProcessThreadGroup
Set the process thread group for this node (basically, whether it receives
notificationProcess
,notificationPhysicsProcess
,_process(delta:)
or_physicsProcess(delta:)
(and the internal versions) on the main thread or in a sub-thread.var processThreadGroupOrder: Int32
Change the process thread group order. Groups with a lesser order will process before groups with a greater order. This is useful when a large amount of nodes process in sub thread and, afterwards, another group wants to collect their result in the main thread, as an example.
var processThreadMessages: Node.ProcessThreadMessages
Set whether the current thread group will process messages (calls to
callDeferredThreadGroup(method:)
on threads), and whether it wants to receive them during regular process or physics process callbacks.var ready: SimpleSignal
Emitted when the node is considered ready, after
_ready
is called.var renamed: SimpleSignal
Emitted when the node’s
name
is changed, if the node is inside the tree.var replacingBy: Signal3
Emitted when this node is being replaced by the
node
, seereplaceBy(node:keepGroups:)
.var sceneFilePath: String
The original scene’s file path, if the node has been instantiated from a
PackedScene
file. Only scene root nodes contains this.var treeEntered: SimpleSignal
Emitted when the node enters the tree.
var treeExited: SimpleSignal
Emitted after the node exits the tree and is no longer active.
var treeExiting: SimpleSignal
Emitted when the node is just about to exit the tree. The node is still valid. As such, this is the right place for de-initialization (or a “destructor”, if you will).
var uniqueNameInOwner: Bool
If
true
, the node can be accessed from any node sharing the sameowner
or from theowner
itself, with special%Name
syntax ingetNode(path:)
.func addChild(node: Node?, forceReadableName: Bool, internal: Node.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.func addSibling(Node?, forceReadableName: Bool
) Adds a
sibling
node to this node’s parent, and moves the added sibling right below this node.func addToGroup(StringName, persistent: Bool
) 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 inSceneTree
.func atr(message: String, context: StringName
) -> String Translates a
message
, using the translation catalogs configured in the Project Settings. Furthercontext
can be specified to help with the translation. Note that mostControl
nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text.func atrN(message: String, pluralMessage: StringName, n: Int32, context: StringName
) -> String Translates a
message
orpluralMessage
, using the translation catalogs configured in the Project Settings. Furthercontext
can be specified to help with the translation.func callDeferredThreadGroup(method: StringName, Variant...
) -> Variant This function is similar to
Object/callDeferred(method:)
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 beforenotificationProcess
ornotificationPhysicsProcess
, the_process(delta:)
or_physicsProcess(delta:)
or their internal versions are called.func callThreadSafe(method: StringName, Variant...
) -> Variant 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 canProcess(
) -> Bool Returns
true
if the node can receive processing notifications and input callbacks (notificationProcess
,_input(event:)
, etc.) from theSceneTree
andViewport
. The returned value depends onprocessMode
:func createTween(
) -> Tween? Creates a new
Tween
and binds it to this node.func duplicate(flags: Int32
) -> Node? Duplicates the node, returning a new node with all of its properties, signals and groups copied from the original. The behavior can be tweaked through the
flags
(seeDuplicateFlags
).func findChild(pattern: String, recursive: Bool, owned: Bool
) -> Node? Finds the first descendant of this node whose
name
matchespattern
, returningnull
if no match is found. The matching is done against node names, not their paths, throughString/match(expr:)
. As such, it is case-sensitive,"*"
matches zero or more characters, and"?"
matches any single character.func findChildren(pattern: String, type: String, recursive: Bool, owned: Bool
) -> ObjectCollection<Node> Finds all descendants of this node whose names match
pattern
, returning an emptyGArray
if no match is found. The matching is done against node names, not their paths, throughString/match(expr:)
. As such, it is case-sensitive,"*"
matches zero or more characters, and"?"
matches any single character.func findParent(pattern: String
) -> Node? Finds the first ancestor of this node whose
name
matchespattern
, returningnull
if no match is found. The matching is done throughString/match(expr:)
. As such, it is case-sensitive,"*"
matches zero or more characters, and"?"
matches any single character. See alsofindChild(pattern:recursive:owned:)
andfindChildren(pattern:type:recursive:owned:)
.func getChild(idx: Int32, includeInternal: Bool
) -> Node? Fetches a child node by its index. Each child node has an index relative its siblings (see
getIndex(includeInternal:)
). 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 withgetChildCount(includeInternal:)
to iterate over this node’s children. If no child exists at the given index, this method returnsnull
and an error is generated.func getChildCount(includeInternal: Bool
) -> Int32 Returns the number of children of this node.
func getChildren(includeInternal: Bool
) -> ObjectCollection<Node> Returns all children of this node inside an
GArray
.func getGroups(
) -> VariantCollection<StringName> Returns an
GArray
of group names that the node has been added to.func getIndex(includeInternal: Bool
) -> Int32 Returns this node’s order among its siblings. The first node’s index is
0
. See alsogetChild(idx:includeInternal:)
.func getLastExclusiveWindow(
) -> Window? Returns the
Window
that contains this node, or the last exclusive child in a chain of windows starting with the one that contains this node.func getMultiplayerAuthority(
) -> Int32 Returns the peer ID of the multiplayer authority for this node. See
setMultiplayerAuthority(id:recursive:)
.func getNode(path: NodePath
) -> Node? Fetches a node. The
NodePath
can either be a relative path (from this node), or an absolute path (from theroot
) to a node. Ifpath
does not point to a valid node, generates an error and returnsnull
. Attempts to access methods on the return value will result in an “Attempt to callon a null instance.” error.func getNodeAndResource(path: NodePath
) -> GArray Fetches a node and its most nested resource as specified by the
NodePath
’s subname. Returns anGArray
of size3
where:func getNodeOrNull(path: NodePath
) -> Node? Fetches a node by
NodePath
. Similar togetNode(path:)
, but does not generate an error ifpath
does not point to a valid node.func getParent(
) -> Node? Returns this node’s parent node, or
null
if the node doesn’t have a parent.func getPath(
) -> NodePath Returns the node’s absolute path, relative to the
root
. If the node is not inside the scene tree, this method fails and returns an emptyNodePath
.func getPathTo(node: Node?, useUniquePath: Bool
) -> NodePath Returns the relative
NodePath
from this node to the specifiednode
. Both nodes must be in the sameSceneTree
or scene hierarchy, otherwise this method fails and returns an emptyNodePath
.func getPhysicsProcessDeltaTime(
) -> Double Returns the time elapsed (in seconds) since the last physics callback. This value is identical to
_physicsProcess(delta:)
’sdelta
parameter, and is often consistent at run-time, unlessphysicsTicksPerSecond
is changed. See alsonotificationPhysicsProcess
.func getProcessDeltaTime(
) -> Double Returns the time elapsed (in seconds) since the last process callback. This value is identical to
_process(delta:)
’sdelta
parameter, and may vary from frame to frame. See alsonotificationProcess
.func getSceneInstanceLoadPlaceholder(
) -> Bool Returns
true
if this node is an instance load placeholder. SeeInstancePlaceholder
andsetSceneInstanceLoadPlaceholder(_:)
.func getTree(
) -> SceneTree? Returns the
SceneTree
that contains this node. If this node is not inside the tree, generates an error and returnsnull
. See alsoisInsideTree
.func getTreeString(
) -> String 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 thegetNode(path:)
function. It also can be used in game UI/UX.func getTreeStringPretty(
) -> String Similar to
getTreeString
, this returns the tree as aString
. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees.func getViewport(
) -> Viewport? Returns the node’s closest
Viewport
ancestor, if the node is inside the tree. Otherwise, returnsnull
.func getWindow(
) -> Window? Returns the
Window
that contains this node. If the node is in the main window, this is equivalent to getting the root node (get_tree().get_root()
).func hasNode(path: NodePath
) -> Bool Returns
true
if thepath
points to a valid node. See alsogetNode(path:)
.func hasNodeAndResource(path: NodePath
) -> Bool Returns
true
ifpath
points to a valid node and its subnames point to a validResource
, e.g.Area2D/CollisionShape2D:shape
. Properties that are notResource
types (such as nodes or otherVariant
types) are not considered. See alsogetNodeAndResource(path:)
.func isAncestorOf(node: Node?
) -> Bool Returns
true
if the givennode
is a direct or indirect child of this node.func isDisplayedFolded(
) -> Bool 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 alsosetDisplayFolded(fold:)
.func isEditableInstance(node: Node?
) -> Bool Returns
true
ifnode
has editable children enabled relative to this node. This method is intended to be used in editor plugins and tools. See alsosetEditableInstance(node:isEditable:)
.func isGreaterThan(node: Node?
) -> Bool Returns
true
if the givennode
occurs later in the scene hierarchy than this node. A node occurring later is usually processed last.func isInGroup(StringName
) -> Bool Returns
true
if this node has been added to the givengroup
. SeeaddToGroup(_:persistent:)
andremoveFromGroup(_:)
. See also notes in the description, and theSceneTree
’s group methods.func isInsideTree(
) -> Bool Returns
true
if this node is currently inside aSceneTree
. See alsogetTree
.func isMultiplayerAuthority(
) -> Bool Returns
true
if the local system is the multiplayer authority of this node.func isNodeReady(
) -> Bool Returns
true
if the node is ready, i.e. it’s inside scene tree and all its children are initialized.func isPartOfEditedScene(
) -> Bool Returns
true
if the node is part of the scene currently opened in the editor.func isPhysicsInterpolated(
) -> Bool Returns
true
if physics interpolation is enabled for this node (seephysicsInterpolationMode
).func isPhysicsInterpolatedAndEnabled(
) -> Bool Returns
true
if physics interpolation is enabled (seephysicsInterpolationMode
) and enabled in theSceneTree
.func isPhysicsProcessing(
) -> Bool Returns
true
if physics processing is enabled (seesetPhysicsProcess(enable:)
).func isPhysicsProcessingInternal(
) -> Bool Returns
true
if internal physics processing is enabled (seesetPhysicsProcessInternal(enable:)
).func isProcessing(
) -> Bool Returns
true
if processing is enabled (seesetProcess(enable:)
).func isProcessingInput(
) -> Bool Returns
true
if the node is processing input (seesetProcessInput(enable:)
).func isProcessingInternal(
) -> Bool Returns
true
if internal processing is enabled (seesetProcessInternal(enable:)
).func isProcessingShortcutInput(
) -> Bool Returns
true
if the node is processing shortcuts (seesetProcessShortcutInput(enable:)
).func isProcessingUnhandledInput(
) -> Bool Returns
true
if the node is processing unhandled input (seesetProcessUnhandledInput(enable:)
).func isProcessingUnhandledKeyInput(
) -> Bool Returns
true
if the node is processing unhandled key input (seesetProcessUnhandledKeyInput(enable:)
).func moveChild(childNode: Node?, toIndex: Int32
) Moves
childNode
to the given index. A node’s index is the order among its siblings. IftoIndex
is negative, the index is counted from the end of the list. See alsogetChild(idx:includeInternal:)
andgetIndex(includeInternal:)
.func notifyDeferredThreadGroup(what: Int32
) Similar to
callDeferredThreadGroup(method:)
, but for notifications.func notifyThreadSafe(what: Int32
) Similar to
callThreadSafe(method:)
, but for notifications.func printTree(
) Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs
NodePath
s relative to this node, and is good for copy/pasting intogetNode(path:)
. See alsoprintTreePretty
.func printTreePretty(
) Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to
printTree
, but the graphical representation looks like what is displayed in the editor’s Scene dock. It is useful for inspecting larger trees.func propagateCall(method: StringName, args: GArray, parentFirst: Bool
) Calls the given
method
name, passingargs
as arguments, on this node and all of its children, recursively.func propagateNotification(what: Int32
) Calls
notification(what:reversed:)
withwhat
on this node and all of its children, recursively.func 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.
func removeChild(node: Node?
) Removes a child
node
. Thenode
, along with its children, are not deleted. To delete a node, seequeueFree
.func removeFromGroup(StringName
) Removes the node from the given
group
. Does nothing if the node is not in thegroup
. See also notes in the description, and theSceneTree
’s group methods.func reparent(newParent: Node?, keepGlobalTransform: Bool
) Changes the parent of this
Node
to thenewParent
. The node needs to already have a parent. The node’sowner
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).func replaceBy(node: Node?, keepGroups: Bool
) Replaces this node by the given
node
. All children of this node are moved tonode
.func requestReady(
) Requests
_ready
to be called again the next time the node enters the tree. Does not immediately call_ready
.func 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.
func rpc(method: StringName, Variant...
) -> GodotError 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 sameNodePath
, including the exact samename
. Behavior depends on the RPC configuration for the givenmethod
(seerpcConfig(method:config:)
and [annotation @GDScript.@rpc]). By default, methods are not exposed to RPCs.func rpcConfig(method: StringName, config: Variant
) Changes the RPC configuration for the given
method
.config
should either benull
to disable the feature (as by default), or aGDictionary
containing the following entries:func rpcId(peerId: Int64, method: StringName, Variant...
) -> GodotError Sends a
rpc(method:)
to a specific peer identified bypeerId
(seesetTargetPeer(id:)
).func setDeferredThreadGroup(property: StringName, value: Variant
) Similar to
callDeferredThreadGroup(method:)
, but for setting properties.func setDisplayFolded(fold: Bool
) 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 alsoisDisplayedFolded
.func setEditableInstance(node: Node?, isEditable: Bool
) Set to
true
to allow all nodes owned bynode
to be available, and editable, in the Scene dock, even if theirowner
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 alsoisEditableInstance(node:)
.func setMultiplayerAuthority(id: Int32, recursive: Bool
) 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 withrpcConfig(method:config:)
and theMultiplayerAPI
.func setPhysicsProcess(enable: Bool
) If set to
true
, enables physics (fixed framerate) processing. When a node is being processed, it will receive anotificationPhysicsProcess
at a fixed (usually 60 FPS, seephysicsTicksPerSecond
to change) interval (and the_physicsProcess(delta:)
callback will be called if it exists).func setPhysicsProcessInternal(enable: Bool
) If set to
true
, enables internal physics for this node. Internal physics processing happens in isolation from the normal_physicsProcess(delta:)
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 (setPhysicsProcess(enable:)
).func setProcess(enable: Bool
) If set to
true
, enables processing. When a node is being processed, it will receive anotificationProcess
on every drawn frame (and the_process(delta:)
callback will be called if it exists).func setProcessInput(enable: Bool
) If set to
true
, enables input processing.func setProcessInternal(enable: Bool
) If set to
true
, enables internal processing for this node. Internal processing happens in isolation from the normal_process(delta:)
calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting (setProcess(enable:)
).func setProcessShortcutInput(enable: Bool
) If set to
true
, enables shortcut processing for this node.func setProcessUnhandledInput(enable: Bool
) If set to
true
, enables unhandled input processing. It enables the node to receive all input that was not previously handled (usually by aControl
).func setProcessUnhandledKeyInput(enable: Bool
) If set to
true
, enables unhandled key input processing.func setSceneInstanceLoadPlaceholder(Bool
) If set to
true
, the node becomes aInstancePlaceholder
when packed and instantiated from aPackedScene
. See alsogetSceneInstanceLoadPlaceholder
.func setThreadSafe(property: StringName, value: Variant
) Similar to
callThreadSafe(method:)
, but for setting properties.func updateConfigurationWarnings(
) Refreshes the warnings displayed for this node in the Scene dock. Use
_getConfigurationWarnings
to customize the warning messages to display.
Show implementation details (10)
Hide implementation details
func _enterTree(
) Called when the node enters the
SceneTree
(e.g. upon instantiating, scene changing, or after callingaddChild(node:forceReadableName:`internal`:)
in a script). If the node has children, its_enterTree
callback will be called first, and then that of the children.func _exitTree(
) Called when the node is about to leave the
SceneTree
(e.g. upon freeing, scene changing, or after callingremoveChild(node:)
in a script). If the node has children, its_exitTree
callback will be called last, after all its children have left the tree.func _getConfigurationWarnings(
) -> PackedStringArray 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.func _input(event: InputEvent
) Called when there is an input event. The input event propagates up through the node tree until a node consumes it.
func _physicsProcess(delta: Double
) Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the
delta
variable should be constant.delta
is in seconds.func _process(delta: Double
) Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the
delta
time since the previous frame is not constant.delta
is in seconds.func _ready(
) 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
_ready
callbacks get triggered first, and the parent node will receive the ready notification afterwards.func _shortcutInput(event: InputEvent?
) Called when an
InputEventKey
,InputEventShortcut
, orInputEventJoypadButton
hasn’t been consumed by_input(event:)
or any GUIControl
item. It is called before_unhandledKeyInput(event:)
and_unhandledInput(event:)
. The input event propagates up through the node tree until a node consumes it.func _unhandledInput(event: InputEvent?
) Called when an
InputEvent
hasn’t been consumed by_input(event:)
or any GUIControl
item. It is called after_shortcutInput(event:)
and after_unhandledKeyInput(event:)
. The input event propagates up through the node tree until a node consumes it.func _unhandledKeyInput(event: InputEvent?
) Called when an
InputEventKey
hasn’t been consumed by_input(event:)
or any GUIControl
item. It is called after_shortcutInput(event:)
but before_unhandledInput(event:)
. The input event propagates up through the node tree until a node consumes it.
Citizens in SwiftGodot
Conformances
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByArrayLiteral
A type that can be initialized using an array literal.
protocol OptionSet
A type that presents a mathematical set interface to a bit set.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol SetAlgebra<Element>
A type that provides mathematical set operations.
Type members
init(rawValue: Int
) static let messages: Node.ProcessThreadMessages
Allows this node to process threaded messages created with
callDeferredThreadGroup(method:)
right before_process(delta:)
is called.static let messagesAll: Node.ProcessThreadMessages
Allows this node to process threaded messages created with
callDeferredThreadGroup(method:)
right before either_process(delta:)
or_physicsProcess(delta:)
are called.static let messagesPhysics: Node.ProcessThreadMessages
Allows this node to process threaded messages created with
callDeferredThreadGroup(method:)
right before_physicsProcess(delta:)
is called.
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
let rawValue: Int
Type features
init(
) Creates an empty option set.
init<S>(S
) Creates a new set from a finite sequence of items.
init(arrayLiteral: Self.Element...
) Creates a set containing the elements of the given array literal.
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.
Instance features
var isEmpty: Bool
A Boolean value that indicates whether the set has no elements.
func contains(Self
) -> Bool Returns a Boolean value that indicates whether a given element is a member of the option set.
func formIntersection(Self
) Removes all elements of this option set that are not also present in the given set.
func formSymmetricDifference(Self
) Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.
func formUnion(Self
) Inserts the elements of another set into this option set.
func insert(Self.Element
) -> (inserted: Bool, memberAfterInsert: Self.Element) Adds the given element to the option set if it is not already a member.
func intersection(Self
) -> Self Returns a new option set with only the elements contained in both this set and the given set.
func isDisjoint(with: Self
) -> Bool Returns a Boolean value that indicates whether the set has no members in common with the given set.
func isStrictSubset(of: Self
) -> Bool Returns a Boolean value that indicates whether this set is a strict subset of the given set.
func isStrictSuperset(of: Self
) -> Bool Returns a Boolean value that indicates whether this set is a strict superset of the given set.
func isSubset(of: Self
) -> Bool Returns a Boolean value that indicates whether the set is a subset of another set.
func isSuperset(of: Self
) -> Bool Returns a Boolean value that indicates whether the set is a superset of the given set.
func remove(Self.Element
) -> Self.Element? Removes the given element and all elements subsumed by it.
func subtract(Self
) Removes the elements of the given set from this set.
func subtracting(Self
) -> Self Returns a new set containing the elements of this set that do not occur in the given set.
func symmetricDifference(Self
) -> Self Returns a new option set with the elements contained in this set or in the given set, but not in both.
func union(Self
) -> Self Returns a new option set of the elements contained in this set, in the given set, or in both.
func update(with: Self.Element
) -> Self.Element? Inserts the given element into the set.