Expand description
An extendable system made up of autonomous execution services known as nodes organized in a tree of processes. Inspired by Godot!
A simple node implementation will look like the following:
use node_tree::prelude::*;
#[derive(Debug, Clone, Abstract, Register)] // Nodes require `Debug` and `Clone`.
pub struct NodeA {
base: NodeBase // Required for Nodes.
}
impl NodeA {
fn new(name: String) -> Self {
NodeA { base: NodeBase::new(name) }
}
}
impl Node for NodeA {
// feel free to implement `loaded()`, `ready()`, `process()`, `terminal()` and/or `process_mode()`
// here.
}
Or with the class!
macro, you could have an even simpler node declaration:
use node_tree::prelude::*;
class! {
pub dec NodeA;
// See the class! documentation for how you can implement custom fields, functions, and
// hooks such as `ready()` or `process()`.
// NodeBase initialization and attribute/derive macros are implemented for you!
}
Re-exports§
pub use ctor;
Modules§
- Contains everything you’ll need to create and handle Nodes and NodeTrees. You’ll probably want to import all from this module.