Struct gdnative_core::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]
impl NodePathpub fn from_str(path: &str) -> Self[src]
pub fn from_str(path: &str) -> SelfCreate 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.
pub fn from_godot_string(path: &GodotString) -> Self[src]
pub fn from_godot_string(path: &GodotString) -> SelfCreate a NodePath from a GodotString.
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolReturns true if the node path is empty.
pub fn is_absolute(&self) -> bool[src]
pub fn is_absolute(&self) -> boolReturns true if the node path is absolute.
pub fn name_count(&mut self) -> i32[src]
pub fn name_count(&mut self) -> i32pub fn subname(&self, idx: i32) -> GodotString[src]
pub fn subname(&self, idx: i32) -> GodotStringReturns the resource name of the specified idx, 0 to subname_count()
pub fn subname_count(&self) -> i32[src]
pub fn subname_count(&self) -> i32Returns the number of resource names in the path.
pub fn concatenated_subnames(&self) -> GodotString[src]
pub fn concatenated_subnames(&self) -> GodotStringpub fn to_godot_string(&self) -> GodotString[src]
pub fn to_godot_string(&self) -> GodotStringReturns the NodePath as a GodotString
pub fn to_string(&self) -> String[src]
pub fn to_string(&self) -> StringReturns the NodePath as a String
pub fn new_ref(&self) -> NodePath[src]
pub fn new_ref(&self) -> NodePathTrait Implementations
impl<'l> From<&'l NodePath> for Variant[src]
impl<'l> From<&'l NodePath> for Variantimpl Drop for NodePath[src]
impl Drop for NodePathimpl PartialEq for NodePath[src]
impl PartialEq for NodePathfn eq(&self, other: &Self) -> bool[src]
fn eq(&self, other: &Self) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Eq for NodePath[src]
impl Eq for NodePathimpl ToVariant for NodePath[src]
impl ToVariant for NodePathfn to_variant(&self) -> Variant[src]
fn to_variant(&self) -> Variantfn from_variant(variant: &Variant) -> Option<Self>[src]
fn from_variant(variant: &Variant) -> Option<Self>impl Debug for NodePath[src]
impl Debug for NodePath