2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								<?xml version="1.0" encoding="UTF-8" ?>  
						 
					
						
							
								
									
										
										
										
											2023-07-06 10:08:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								<class  name= "NodePath"  xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation= "../class.xsd" >  
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									<brief_description > 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-28 01:35:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										A pre-parsed scene tree path.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									</brief_description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-20 04:09:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										A pre-parsed relative or absolute path in a scene tree, for use with [method Node.get_node] and similar functions. It can reference a node, a resource within a node, or a property of a node or resource. For example, [code]"Path2D/PathFollow2D/Sprite2D:texture:size"[/code] would refer to the [code]size[/code] property of the [code]texture[/code] resource on the node named [code]"Sprite2D"[/code] which is a child of the other named nodes in the path.
							 
						 
					
						
							
								
									
										
										
										
											2022-03-13 01:04:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										You will usually just pass a string to [method Node.get_node] and it will be automatically converted, but you may occasionally want to parse a path ahead of time with [NodePath] or the literal syntax [code]^"path"[/code]. Exporting a [NodePath] variable will give you a node selection widget in the properties panel of the editor, which can often be useful.
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										A [NodePath] is composed of a list of slash-separated node names (like a filesystem path) and an optional colon-separated list of "subnames" which can be resources or properties.
							 
						 
					
						
							
								
									
										
										
										
											2019-11-13 12:08:39 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Some examples of NodePaths include the following:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										[codeblock]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										# No leading slash means it is relative to the current node.
							 
						 
					
						
							
								
									
										
										
										
											2022-03-13 01:04:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										^"A" # Immediate child A
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										^"A/B" # A's child B
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										^"." # The current node.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										^".." # The parent node.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										^"../C" # A sibling node C.
							 
						 
					
						
							
								
									
										
										
										
											2023-06-25 10:25:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										^"../.." # The grandparent node.
							 
						 
					
						
							
								
									
										
										
										
											2019-11-13 12:08:39 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										# A leading slash means it is absolute from the SceneTree.
							 
						 
					
						
							
								
									
										
										
										
											2022-03-13 01:04:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										^"/root" # Equivalent to get_tree().get_root().
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										^"/root/Main" # If your main scene's root node were named "Main".
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										^"/root/MyAutoload" # If you have an autoloaded node or scene.
							 
						 
					
						
							
								
									
										
										
										
											2019-11-13 12:08:39 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										[/codeblock]
							 
						 
					
						
							
								
									
										
										
										
											2022-03-13 01:04:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										See also [StringName], which is a similar concept for general-purpose string interning.
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 12:09:00 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										[b]Note:[/b] In the editor, [NodePath] properties are automatically updated when moving, renaming or deleting a node in the scene tree, but they are never updated at runtime.
							 
						 
					
						
							
								
									
										
										
										
											2023-04-28 01:35:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										[b]Note:[/b] In a boolean context, a [NodePath] will evaluate to [code]false[/code] if it is empty ([code]NodePath("")[/code]). Otherwise, a [NodePath] will always evaluate to [code]true[/code].
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<tutorials > 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-01 04:34:47 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<link  title= "2D Role Playing Game Demo" > https://godotengine.org/asset-library/asset/520</link> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									</tutorials> 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 21:49:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									<constructors > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<constructor  name= "NodePath" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "NodePath"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-09 17:46:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Constructs an empty [NodePath].
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 21:49:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										</constructor> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<constructor  name= "NodePath" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "NodePath"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "from"  type= "NodePath"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-09 17:46:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-13 01:04:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Constructs a [NodePath] as a copy of the given [NodePath]. [code]NodePath("example")[/code] is equivalent to [code]^"example"[/code].
							 
						 
					
						
							
								
									
										
										
										
											2020-11-09 17:46:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 21:49:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										</constructor> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<constructor  name= "NodePath" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "NodePath"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "from"  type= "String"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2020-03-30 18:22:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Creates a NodePath from a string, e.g. [code]"Path2D/PathFollow2D/Sprite2D:texture:size"[/code]. A path is absolute if it starts with a slash. Absolute paths are only valid in the global scene tree, not within individual scenes. In a relative path, [code]"."[/code] and [code]".."[/code] indicate the current node and its parent.
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												The "subnames" optionally included after the path to the target node can point to resources or properties, and can also be nested.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Examples of valid NodePaths (assuming that those nodes exist and have the referenced resources or properties):
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[codeblock]
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												# Points to the Sprite2D node.
							 
						 
					
						
							
								
									
										
										
										
											2020-03-30 18:22:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"Path2D/PathFollow2D/Sprite2D"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												# Points to the Sprite2D node and its "texture" resource.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												# get_node() would retrieve "Sprite2D", while get_node_and_resource()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												# would retrieve both the Sprite2D node and the "texture" resource.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												"Path2D/PathFollow2D/Sprite2D:texture"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												# Points to the Sprite2D node and its "position" property.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												"Path2D/PathFollow2D/Sprite2D:position"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												# Points to the Sprite2D node and the "x" component of its "position" property.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												"Path2D/PathFollow2D/Sprite2D:position:x"
							 
						 
					
						
							
								
									
										
										
										
											2019-06-22 01:04:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												# Absolute path (from "root")
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"/root/Level/Path2D"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/codeblock]
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 21:49:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										</constructor> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</constructors> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<methods > 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:44:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "get_as_property_path"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "NodePath"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 09:16:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 12:04:28 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns a node path with a colon character ([code]:[/code]) prepended, transforming it to a pure property path with no node name (defaults to resolving from the current node).
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												[codeblocks]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[gdscript]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												# This will be parsed as a node path to the "x" property in the "position" node.
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												var node_path = NodePath("position:x")
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												# This will be parsed as a node path to the "x" component of the "position" property in the current node.
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												var property_path = node_path.get_as_property_path()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												print(property_path) # :position:x
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												[/gdscript]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												// This will be parsed as a node path to the "x" property in the "position" node.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												var nodePath = new NodePath("position:x");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												// This will be parsed as a node path to the "x" component of the "position" property in the current node.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												NodePath propertyPath = nodePath.GetAsPropertyPath();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												GD.Print(propertyPath); // :position:x
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/codeblocks]
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 09:16:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-27 17:06:50 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "get_concatenated_names"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "StringName"  /> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Returns all paths concatenated with a slash character ([code]/[/code]) as separator without subnames.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:44:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "get_concatenated_subnames"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "StringName"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 09:16:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns all subnames concatenated with a colon character ([code]:[/code]) as separator, i.e. the right side of the first colon in a node path.
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												[codeblocks]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[gdscript]
							 
						 
					
						
							
								
									
										
										
										
											2020-03-30 18:22:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												var nodepath = NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path")
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												print(nodepath.get_concatenated_subnames()) # texture:load_path
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												[/gdscript]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												var nodepath = new NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												GD.Print(nodepath.GetConcatenatedSubnames()); // texture:load_path
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/codeblocks]
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 09:16:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:44:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "get_name"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "StringName"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "idx"  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-12 09:36:48 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Gets the node name indicated by [param idx] (0 to [method get_name_count] - 1).
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												[codeblocks]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[gdscript]
							 
						 
					
						
							
								
									
										
										
										
											2020-03-30 18:22:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												var node_path = NodePath("Path2D/PathFollow2D/Sprite2D")
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												print(node_path.get_name(0)) # Path2D
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												print(node_path.get_name(1)) # PathFollow2D
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												print(node_path.get_name(2)) # Sprite
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												[/gdscript]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												var nodePath = new NodePath("Path2D/PathFollow2D/Sprite2D");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												GD.Print(nodePath.GetName(0)); // Path2D
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												GD.Print(nodePath.GetName(1)); // PathFollow2D
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												GD.Print(nodePath.GetName(2)); // Sprite
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/codeblocks]
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:44:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "get_name_count"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-22 01:04:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Gets the number of node names which make up the path. Subnames (see [method get_subname_count]) are not included.
							 
						 
					
						
							
								
									
										
										
										
											2020-03-30 18:22:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												For example, [code]"Path2D/PathFollow2D/Sprite2D"[/code] has 3 names.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:44:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "get_subname"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "StringName"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "idx"  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-26 09:54:37 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Gets the resource or property name indicated by [param idx] (0 to [method get_subname_count] - 1).
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												[codeblocks]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[gdscript]
							 
						 
					
						
							
								
									
										
										
										
											2020-03-30 18:22:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												var node_path = NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path")
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												print(node_path.get_subname(0)) # texture
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												print(node_path.get_subname(1)) # load_path
							 
						 
					
						
							
								
									
										
										
										
											2020-10-31 18:54:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												[/gdscript]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												var nodePath = new NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												GD.Print(nodePath.GetSubname(0)); // texture
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												GD.Print(nodePath.GetSubname(1)); // load_path
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/csharp]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												[/codeblocks]
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:44:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "get_subname_count"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "int"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-22 01:04:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Gets the number of resource or property names ("subnames") in the path. Each subname is listed after a colon character ([code]:[/code]) in the node path.
							 
						 
					
						
							
								
									
										
										
										
											2020-03-30 18:22:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												For example, [code]"Path2D/PathFollow2D/Sprite2D:texture:load_path"[/code] has 2 subnames.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-06 12:19:56 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "hash"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "int"  /> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Returns the 32-bit hash value representing the [NodePath]'s contents.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:44:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "is_absolute"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "bool"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-26 15:15:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns [code]true[/code] if the node path is absolute (as opposed to relative), which means that it starts with a slash character ([code]/[/code]). Absolute node paths can be used to access the root node ([code]"/root"[/code]) or autoloads (e.g. [code]"/global"[/code] if a "global" autoload was registered).
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-18 14:44:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<method  name= "is_empty"  qualifiers= "const" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "bool"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-23 19:15:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns [code]true[/code] if the node path is empty.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 21:49:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									</methods> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<operators > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<operator  name= "operator !=" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "bool"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "right"  type= "NodePath"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-10 14:16:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-21 03:48:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns [code]true[/code] if two node paths are not equal.
							 
						 
					
						
							
								
									
										
										
										
											2020-11-10 14:16:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 21:49:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										</operator> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<operator  name= "operator ==" > 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-30 15:28:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<return  type= "bool"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 21:11:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<param  index= "0"  name= "right"  type= "NodePath"  /> 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-10 14:16:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2022-11-21 03:48:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns [code]true[/code] if two node paths are equal, i.e. all node names in the path are the same and in the same order.
							 
						 
					
						
							
								
									
										
										
										
											2020-11-10 14:16:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-20 21:49:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										</operator> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</operators> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								</class>