pub struct NodeConstructor<'a> { /* private fields */ }
Expand description
Used to construct a node and stores the relevant ui code for its title and attributes This is used so that the nodes can be rendered in the context depth order
Implementations§
Source§impl<'a, 'b> NodeConstructor<'a>
impl<'a, 'b> NodeConstructor<'a>
Sourcepub fn new(id: usize, args: NodeArgs) -> Self
pub fn new(id: usize, args: NodeArgs) -> Self
Create a new node to be displayed in a Context. id should be the same accross frames and should not be the same as any other currently used nodes
Sourcepub fn with_title(self, title: impl FnOnce(&mut Ui) -> Response + 'a) -> Self
pub fn with_title(self, title: impl FnOnce(&mut Ui) -> Response + 'a) -> Self
Add a title to a node
Sourcepub fn with_input_attribute(
self,
id: usize,
args: PinArgs,
attribute: impl FnOnce(&mut Ui) -> Response + 'a,
) -> Self
pub fn with_input_attribute( self, id: usize, args: PinArgs, attribute: impl FnOnce(&mut Ui) -> Response + 'a, ) -> Self
Add an input attibute to a node, this attribute can be connected to output attributes of other nodes id should be the same accross frames and should not be the same as any other currently used attributes the attribute should return a egui::Response to be checked for interaction
Sourcepub fn with_output_attribute(
self,
id: usize,
args: PinArgs,
attribute: impl FnOnce(&mut Ui) -> Response + 'a,
) -> Self
pub fn with_output_attribute( self, id: usize, args: PinArgs, attribute: impl FnOnce(&mut Ui) -> Response + 'a, ) -> Self
Add an output attibute to a node, this attribute can be connected to input attributes of other nodes id should be the same accross frames and should not be the same as any other currently used attributes the attribute should return a egui::Response to be checked for interaction
Sourcepub fn with_static_attribute(
self,
id: usize,
attribute: impl FnOnce(&mut Ui) -> Response + 'a,
) -> Self
pub fn with_static_attribute( self, id: usize, attribute: impl FnOnce(&mut Ui) -> Response + 'a, ) -> Self
Add a static attibute to a node, this attribute can’t be connected to any other attributes id should be the same accross frames and should not be the same as any other currently used attributes the attribute should return a egui::Response to be checked for interaction
Sourcepub fn with_origin(self, origin: Pos2) -> Self
pub fn with_origin(self, origin: Pos2) -> Self
Set the position of the node in screen space when it is first created. To modify it after creation use one of the set_node_pos methods of the Context