From f28bb07dec83fddd647878f54c9043600a770d3e Mon Sep 17 00:00:00 2001 From: Max Hilbrunner Date: Tue, 28 Nov 2017 12:41:45 +0100 Subject: [DOCS] Node: Document _process()/_set_process() --- doc/classes/Node.xml | 125 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 73 insertions(+), 52 deletions(-) (limited to 'doc/classes/Node.xml') diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 08b761abe8..eb4ab3e1fb 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -43,6 +43,7 @@ Called when there is a change to input devices. Propagated 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 overriden, and can be toggled with [method set_process_input]. @@ -52,7 +53,7 @@ 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 [code]delta[/code] variable should be constant. - It is only called if physics processing has been enabled with [method set_physics_process]. + It is only called if physics processing is enabled, which is done automatically if this method is overriden, and can be toggled with [method set_physics_process]. Corresponds to the NOTIFICATION_PHYSICS_PROCESS notification in [method Object._notification]. @@ -63,7 +64,7 @@ Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [code]delta[/code] time since the previous frame is not constant. - It is only called if processing has been enabled with [method set_process]. + It is only called if processing is enabled, which is done automatically if this method is overriden, and can be toggled with [method set_process]. Corresponds to the NOTIFICATION_PROCESS notification in [method Object._notification]. @@ -82,6 +83,7 @@ Propagated to all nodes when the previous InputEvent is not consumed by any nodes. + It is only called if unhandled input processing is enabled, which is done automatically if this method is overriden, and can be toggled with [method set_process_unhandled_input]. @@ -154,7 +156,7 @@ - Find a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case sensitive, but '*' matches zero or more characters and '?' matches any single character except '.'). Note that it does not match against the full path, just against individual node names. + Finds a descendant of this node whose name matches [code]mask[/code] as in [method String.match] (i.e. case sensitive, but '*' matches zero or more characters and '?' matches any single character except '.'). Note that it does not match against the full path, just against individual node names. @@ -163,55 +165,56 @@ - Return a child node by its index (see [method get_child_count]). This method is often used for iterating all children of a node. + Returns a child node by its index (see [method get_child_count]). This method is often used for iterating all children of a node. - Return the amount of child nodes. + Returns the amount of child nodes. - Return an array of references ([code]Node[/code]) to the child nodes. + Returns an array of references ([code]Node[/code]) to the child nodes. - Return a filename that may be contained by the node. When a scene is instanced from a file, it topmost node contains the filename from where it was loaded (see [method set_filename]). + Returns a filename that may be contained by the node. When a scene is instanced from a file, it topmost node contains the filename from where it was loaded (see [method set_filename]). - Return an array listing the groups that the node is part of. + Returns an array listing the groups that the node is part of. - Get the node index, i.e. its position among the siblings of its parent. + Returns the node index, i.e. its position among the siblings of its parent. - Return the name of the node. This name is unique among the siblings (other child nodes from the same parent). + Returns the name of the node. This name is unique among the siblings (other child nodes from the same parent). + Returns the peer ID of the network master for this node. @@ -220,7 +223,7 @@ - Fetch a node. The [NodePath] must be valid (or else an error will be raised) and can be either the path to child node, a relative path (from the current node to another node), or an absolute path to a node. + Fetches a node. The [NodePath] must be valid (or else an error will be raised) and can be either the path to child node, a relative path (from the current node to another node), or an absolute path to a node. Note: fetching absolute paths only works when the node is inside the scene tree (see [method is_inside_tree]). [i]Example:[/i] Assume your current node is Character and the following tree: [codeblock] @@ -254,21 +257,21 @@ - Get the node owner (see [method set_owner]). + Returns the node owner (see [method set_owner]). - Return the parent node of the current node, or an empty [code]Node[/code] if the node lacks a parent. + Returns the parent node of the current node, or an empty [code]Node[/code] if the node lacks a parent. - Return the absolute path of the current node. This only works if the current node is inside the scene tree (see [method is_inside_tree]). + Returns the absolute path of the current node. This only works if the current node is inside the scene tree (see [method is_inside_tree]). @@ -277,28 +280,28 @@ - Return the relative path from the current node to the specified node in "node" argument. Both nodes must be in the same scene, or else the function will fail. + Returns the relative path from the current node to the specified node in "node" argument. Both nodes must be in the same scene, or else the function will fail. - Return the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed in [OS]. + Returns the time elapsed since the last physics-bound frame (see [method _physics_process]). This is always a constant value in physics processing unless the frames per second is changed in [OS]. - Return the order in the node tree branch, i.e. if called by the first child Node, return 0. + Returns the order in the node tree branch, i.e. if called by the first child Node, return 0. - Return the time elapsed (in seconds) since the last process callback. This is almost always different each time. + Returns the time elapsed (in seconds) since the last process callback. This is almost always different each time. @@ -311,13 +314,14 @@ - Return a [SceneTree] that this node is inside. + Returns the [SceneTree] that this node is inside. + Returns the [Viewport] for this node. @@ -326,7 +330,7 @@ - Return whether the node that a given [NodePath] points too exists. + Returns [code]true[/code] if the node that the [NodePath] points to exists. @@ -343,7 +347,7 @@ - Return [i]true[/i] if the "node" argument is a direct or indirect child of the current node, otherwise return [i]false[/i]. + Returns [code]true[/code] if the "node" argument is a direct or indirect child of the current node, otherwise return [code]false[code]. @@ -352,7 +356,7 @@ - Return [i]true[/i] if "node" occurs later in the scene hierarchy than the current node, otherwise return [i]false[/i]. + Returns [code]true[/code] if [code]node[/code] occurs later in the scene hierarchy than the current node, otherwise return [code]false[/code]. @@ -361,14 +365,14 @@ - Return whether this Node is in the specified group. + Returns [code]true[/code] if this Node is in the specified group. - Return whether this Node is inside a [SceneTree]. + Returns [code]true[/code] if this Node is currently inside a [SceneTree]. @@ -381,7 +385,7 @@ - Return true if physics processing is enabled (see [method set_physics_process]). + Returns [code]true[/code] if physics processing is enabled (see [method set_physics_process]). @@ -394,14 +398,14 @@ - Return whether processing is enabled in the current node (see [method set_process]). + Returns [code]true[/code] if processing is enabled (see [method set_process]). - Return true if the node is processing input (see [method set_process_input]). + Returns [code]true[/code] if the node is processing input (see [method set_process_input]). @@ -414,13 +418,14 @@ - Return true if the node is processing unhandled input (see [method set_process_unhandled_input]). + Returns [code]true[/code] if the node is processing unhandled input (see [method set_process_unhandled_input]). + Returns [code]true[/code] if the node is processing unhandled key input (see [method set_process_unhandled_key_input]). @@ -431,7 +436,7 @@ - Move a child node to a different position (order) amongst the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. + Moves a child node to a different position (order) amongst the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. @@ -444,7 +449,7 @@ - Print the scene to stdout. Used mainly for debugging purposes. + Prints the scene to stdout. Used mainly for debugging purposes. @@ -480,14 +485,14 @@ - Move this node to the top of the array of nodes of the parent node. This is often useful on GUIs ([Control]), because their order of drawing fully depends on their order in the tree. + Moves this node to the top of the array of nodes of the parent node. This is often useful on GUIs ([Control]), because their order of drawing fully depends on their order in the tree. - Remove a node and set all its children as children of the parent node (if exists). All even subscriptions that pass by the removed node will be unsubscribed. + Removes a node and set all its children as children of the parent node (if exists). All even subscriptions that pass by the removed node will be unsubscribed. @@ -496,7 +501,7 @@ - Remove a child [code]Node[/code]. Node is NOT deleted and will have to be deleted manually. + Removes a child [code]Node[/code]. Node is NOT deleted and will have to be deleted manually. @@ -505,7 +510,7 @@ - Remove a node from a group. + Removes a node from a group. @@ -516,14 +521,14 @@ - Replace a node in a scene by a given one. Subscriptions that pass through this node will be lost. + Replaces a node in a scene by a given one. Subscriptions that pass through this node will be lost. - Request that [code]_ready[/code] be called again. + Requests that [code]_ready[/code] be called again. @@ -532,7 +537,7 @@ - Send a remote procedure call request to all peers on the network (and locally), optionally sending additional data as arguments. Call request will be received by nodes with the same [NodePath]. + Sends a remote procedure call request to all peers on the network (and locally), optionally sending additional data as arguments. Call request will be received by nodes with the same [NodePath]. @@ -543,7 +548,7 @@ - Change the method's RPC mode (one of RPC_MODE_* constants). + Changes the method's RPC mode (one of RPC_MODE_* constants). @@ -554,7 +559,7 @@ - Send a [method rpc] to a specific peer identified by [i]peer_id[/i]. + Sends a [method rpc] to a specific peer identified by [i]peer_id[/i]. @@ -563,7 +568,7 @@ - Send a [method rpc] using an unreliable protocol. + Sends a [method rpc] using an unreliable protocol. @@ -574,7 +579,7 @@ - Send a [method rpc] to a specific peer identified by [i]peer_id[/i] using an unreliable protocol. + Sends a [method rpc] to a specific peer identified by [i]peer_id[/i] using an unreliable protocol. @@ -585,7 +590,7 @@ - Remotely change property's value on other peers (and locally). + Remotely changes property's value on other peers (and locally). @@ -596,7 +601,7 @@ - Change the property's RPC mode (one of RPC_MODE_* constants). + Changes the property's RPC mode (one of RPC_MODE_* constants). @@ -609,7 +614,7 @@ - Remotely change property's value on a specific peer identified by [i]peer_id[/i]. + Remotely changes property's value on a specific peer identified by [i]peer_id[/i]. @@ -620,7 +625,7 @@ - Remotely change property's value on other peers (and locally) using an unreliable protocol. + Remotely changes property's value on other peers (and locally) using an unreliable protocol. @@ -633,7 +638,7 @@ - Remotely change property's value on a specific peer identified by [i]peer_id[/i] using an unreliable protocol. + Remotely changes property's value on a specific peer identified by [i]peer_id[/i] using an unreliable protocol. @@ -651,7 +656,7 @@ - Set the name of the [code]Node[/code]. Name must be unique within parent, and setting an already existing name will cause for the node to be automatically renamed. + Sets the name of the [code]Node[/code]. Name must be unique within parent, and setting an already existing name will cause for the node to be automatically renamed. @@ -662,6 +667,7 @@ + Sets the node network master to the peer with the given peer ID. The network master is the peer that has authority over it on the network. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). @@ -670,7 +676,7 @@ - Set the node owner. A node can have any other node as owner (as long as a valid parent, grandparent, etc ascending in the tree). When saving a node (using SceneSaver) all the nodes it owns will be saved with it. This allows to create complex SceneTrees, with instancing and subinstancing. + Sets the node owner. A node can have any other node as owner (as long as a valid parent, grandparent, etc ascending in the tree). When saving a node (using SceneSaver) all the nodes it owns will be saved with it. This allows to create complex SceneTrees, with instancing and subinstancing. @@ -679,7 +685,7 @@ - Enables or disables the node's physics (alias fixed framerate) processing. When a node is being processed, it will receive a NOTIFICATION_PHYSICS_PROCESS at a fixed (usually 60 fps, check [OS] to change that) interval (and the [method _physics_process] callback will be called if exists). It is common to check how much time was elapsed since the previous frame by calling [method get_physics_process_delta_time]. + Enables or disables the node's physics (alias fixed framerate) processing. When a node is being processed, it will receive a NOTIFICATION_PHYSICS_PROCESS at a fixed (usually 60 fps, check [OS] to change that) interval (and the [method _physics_process] callback will be called if exists). Enabled automatically if [method _physics_process] is overriden. Any calls to this before [method _ready] will be ignored. @@ -696,7 +702,7 @@ - Enables or disables node processing. When a node is being processed, it will receive a NOTIFICATION_PROCESS on every drawn frame (and the [method _process] callback will be called if exists). It is common to check how much time was elapsed since the previous frame by calling [method get_process_delta_time]. + Enables or disables node processing. When a node is being processed, it will receive a NOTIFICATION_PROCESS on every drawn frame (and the [method _process] callback will be called if exists). Enabled automatically if [method _process] is overriden. Any calls to this before [method _ready] will be ignored. @@ -705,7 +711,7 @@ - Enable input processing for node. This is not required for GUI controls! It hooks up the node to receive all input (see [method _input]). + Enables input processing for node. This is not required for GUI controls! It hooks up the node to receive all input (see [method _input]). Enabled automatically if [method _input] is overriden. Any calls to this before [method _ready] will be ignored. @@ -722,7 +728,7 @@ - Enable unhandled input processing for node. This is not required for GUI controls! It hooks up the node to receive all input that was not previously handled before (usually by a [Control]). (see [method _unhandled_input]). + Enables unhandled input processing for node. This is not required for GUI controls! It hooks up the node to receive all input that was not previously handled before (usually by a [Control]). Enabled automatically if [method _unhandled_input] is overriden. Any calls to this before [method _ready] will be ignored. @@ -731,6 +737,7 @@ + Enables unhandled key input processing for node. Enabled automatically if [method _unhandled_key_input] is overriden. Any calls to this before [method _ready] will be ignored. @@ -769,16 +776,22 @@ + Notification received when the node enters a [SceneTree]. + Notification received when the node exits a [SceneTree]. + Notification received when the node is moved in the parent. + Notification received when the node is ready. See [method _ready]. + Notification received when the node is paused. + Notification received when the node is unpaused. Notification received every frame when the physics process flag is set (see [method set_physics_process]). @@ -793,12 +806,16 @@ Notification received when a node is unparented (parent removed it from the list of children). + Notification received when the node is instanced. + Notification received when a drag begins. + Notification received when a drag ends. + Notification received when the node's [NodePath] changed. @@ -830,12 +847,16 @@ Continue to process regardless of SceneTree pause state. + Duplicate the node's signals. + Duplicate the node's groups. + Duplicate the node's scripts. + Duplicate using instancing. -- cgit v1.2.3