Pre-parsed scene tree path.
    public class NodePath : IDisposable

A pre-parsed relative or absolute path in a scene tree, for use with Node.GetNode(Godot.NodePath) and similar functions. It can reference a node, a resource within a node, or a property of a node or resource. For instance, "Path2D/PathFollow2D/Sprite:texture:size" would refer to the size property of the texture resource on the node named “Sprite” which is a child of the other named nodes in the path. Note that if you want to get a resource, you must end the path with a colon, otherwise the last element will be used as a property name.

You will usually just pass a string to Node.GetNode(Godot.NodePath) and it will be automatically converted, but you may occasionally want to parse a path ahead of time with NodePath or the literal syntax @"path". Exporting a NodePath variable will give you a node selection widget in the properties panel of the editor, which can often be useful.

A NodePath is made up of a list of node names, a list of “subnode” (resource) names, and the name of a property in the final node or resource.

Inheritance Chain

Constructors

    public NodePath()

    public NodePath(string path)

Create a NodePath from a string, e.g. “Path2D/PathFollow2D/Sprite:texture:size”. 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, "." and ".." indicate the current node and its parent.

Properties

    public IntPtr NativeInstance { get; }

Methods

    public void Dispose()

    protected virtual void Dispose(bool disposing)

    public NodePath get_as_property_path()

    public string get_concatenated_subnames()

    public string get_name(int idx)

Get the node name indicated by idx (0 to get_name_count())

    public int get_name_count()

Get the number of node names which make up the path.

    public string get_subname(int idx)

Get the resource name indicated by idx (0 to get_subname_count())

    public int get_subname_count()

Get the number of resource names in the path.

    public bool is_absolute()

Return true if the node path is absolute (not relative).

    public bool is_empty()

Return true if the node path is empty.

Conversion Operators

    public static implicit operator NodePath(string from)

    public static implicit operator string(NodePath from)
Tags: