pub trait Draw: 'static {
// Required method
fn draw(&self, ctx: &mut DrawCtx);
// Provided method
fn size(&self) -> (f64, f64) { ... }
}Expand description
What a node of your own draws, in its own coordinates (origin at the center of its box, y down).
draw must be a function of the node’s values and ctx.time(): the
frame is painted again on seek, and check reports a node whose two
paints of one frame differ. Use ctx.rng(seed) for randomness.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".