[−][src]Struct gdnative::prelude::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::new
.
A NodePath
consists of node names, “sub-node” (resource) names, and the name of a property in
the final node or resource.
More info at Godot's official documentation
Implementations
impl NodePath
[src]
pub fn from_str(path: &str) -> NodePath
[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.
pub fn new(path: &GodotString) -> NodePath
[src]
Create a NodePath
from a GodotString.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the node path is empty.
pub fn is_absolute(&self) -> bool
[src]
Returns true
if the node path is absolute.
pub fn name_count(&mut self) -> i32
[src]
Get the number of node names which make up the path.
pub fn get_subname(&self, idx: i32) -> GodotString
[src]
Returns the resource name of the specified idx
, 0 to subname_count()
pub fn get_subname_count(&self) -> i32
[src]
Returns the number of resource names in the path.
pub fn get_concatenated_subnames(&self) -> GodotString
[src]
pub fn to_godot_string(&self) -> GodotString
[src]
Returns the NodePath
as a GodotString
Trait Implementations
impl Debug for NodePath
[src]
impl Drop for NodePath
[src]
impl Eq for NodePath
[src]
impl Export for NodePath
[src]
type Hint = ()
A type-specific hint type that is valid for the type being exported.
fn export_info(_hint: Option<<NodePath as Export>::Hint>) -> ExportInfo
[src]
impl From<GodotString> for NodePath
[src]
fn from(s: GodotString) -> NodePath
[src]
impl<S> From<S> for NodePath where
S: AsRef<str>,
[src]
S: AsRef<str>,
impl FromVariant for NodePath
[src]
fn from_variant(variant: &Variant) -> Result<NodePath, FromVariantError>
[src]
impl Into<GodotString> for NodePath
[src]
fn into(self) -> GodotString
[src]
impl Into<String> for NodePath
[src]
impl NewRef for NodePath
[src]
impl PartialEq<NodePath> for NodePath
[src]
impl ToString for NodePath
[src]
impl ToVariant for NodePath
[src]
fn to_variant(&self) -> Variant
[src]
impl ToVariantEq for NodePath
[src]
Auto Trait Implementations
impl RefUnwindSafe for NodePath
impl Send for NodePath
impl Sync for NodePath
impl Unpin for NodePath
impl UnwindSafe for NodePath
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> OwnedToVariant for T where
T: ToVariant,
[src]
T: ToVariant,
fn owned_to_variant(self) -> Variant
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,