Class NodePath

NodePath metatype, wrapper for godot_node_path.

Construct using the idiom NodePath(path), which calls __new.

Methods

NodePath:as_string () Gets a String that represents this NodePath.
NodePath:get_as_property_path () Returns a node path with a colon character (:) prepended, transforming it to a pure property path with no node name (defaults to resolving from the current node).
NodePath:get_concatenated_subnames () Returns all subnames concatenated with a colon character (:) as separator, i.e.
NodePath:get_name (idx) Gets the node name indicated by idx.
NodePath:get_name_count () Gets the number of node names which make up the path.
NodePath:get_subname (idx) Gets the resource or property name indicated by idx.
NodePath:get_subname_count () Gets the number of resource or property names ("subnames") in the path.
NodePath:is_absolute () Returns true if the node path is absolute (as opposed to relative), which means that it starts with a slash character (/).
NodePath:is_empty () Returns true if the node path is empty.

Metamethods

NodePath:__concat (a, b) Concatenates values.
NodePath:__eq (a, b) Equality comparison (a == b).
NodePath:__new ([path]) NodePath constructor, called by the idiom NodePath(path).
NodePath:__tostring () Returns a Lua string representation of this NodePath.


Methods

NodePath:as_string ()
Gets a String that represents this NodePath.

Returns:

    String
NodePath:get_as_property_path ()
Returns a node path with a colon character (:) prepended, transforming it to a pure property path with no node name (defaults to resolving from the current node).

Returns:

    String
NodePath:get_concatenated_subnames ()
Returns all subnames concatenated with a colon character (:) as separator, i.e. the right side of the first colon in a node path.

Returns:

    String
NodePath:get_name (idx)
Gets the node name indicated by idx.

Parameters:

  • idx int

Returns:

    String
NodePath:get_name_count ()
Gets the number of node names which make up the path. Subnames (see get_subname_count) are not included.

Returns:

    int
NodePath:get_subname (idx)
Gets the resource or property name indicated by idx.

Parameters:

  • idx int

Returns:

    String
NodePath:get_subname_count ()
Gets the number of resource or property names ("subnames") in the path. Each subname is listed after a colon character (:) in the node path.

Returns:

    int
NodePath:is_absolute ()
Returns true if the node path is absolute (as opposed to relative), which means that it starts with a slash character (/).

Returns:

    bool
NodePath:is_empty ()
Returns true if the node path is empty.

Returns:

    bool

Metamethods

NodePath:__concat (a, b)
Concatenates values.

Parameters:

  • a First value, stringified with GD.str
  • b First value, stringified with GD.str

Returns:

    String
NodePath:__eq (a, b)
Equality comparison (a == b). If either a or b are not of type NodePath, String or Lua string, always return false.

Parameters:

  • a
  • b

Returns:

    bool
NodePath:__new ([path])

NodePath constructor, called by the idiom NodePath(path).

  • NodePath(): empty NodePath
  • NodePath(any path): created with path stringified with GD.str
  • NodePath(NodePath other): copy from other

Parameters:

  • path (optional)

Returns:

    NodePath
NodePath:__tostring ()
Returns a Lua string representation of this NodePath.

Returns:

    string

See also:

generated by LDoc 1.4.6 Last updated 2023-01-04 08:52:34