Struct gdnative::NodePath [] [src]

pub struct NodePath(_);

A reference-counted relative or absolute path in a scene tree, for use with Node.get_node() and similar functions. It can reference a node, a resource within a node, or a property of a node or resource.

"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.

If a string is passed to Node.get_node(), it will be automatically converted to a NodePath, but NodePath can be parsed ahead of time with NodePath::from_str() or NodePath::from_godot_string().

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

Methods

impl NodePath
[src]

[src]

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.

[src]

Create a NodePath from a GodotString.

[src]

Returns true if the node path is empty.

[src]

Returns true if the node path is absolute.

[src]

[src]

Returns the resource name of the specified idx, 0 to subname_count()

[src]

Returns the number of resource names in the path.

[src]

[src]

Returns the NodePath as a GodotString

[src]

Returns the NodePath as a String

[src]

Trait Implementations

impl<'l> From<&'l NodePath> for Variant
[src]

[src]

Performs the conversion.

impl Drop for NodePath
[src]

[src]

Executes the destructor for this type. Read more

impl PartialEq for NodePath
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Eq for NodePath
[src]

impl GodotType for NodePath
[src]

[src]

[src]

[src]

impl Debug for NodePath
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for NodePath

impl Sync for NodePath