struct
ParticleSystem
pub struct ParticleSystem {
pub particles: Vec<Particle>,
/* private fields */
}A running particle background.
Fields
Methods
new
pub fn new(options: ParticleOptions, width: f32, height: f32) -> ParticleSystemA particle system with options, on a surface width by height.
resize
pub fn resize(&mut self, width: f32, height: f32)A new size; with a density, particles are added or removed to suit.
set_pointer
pub fn set_pointer(&mut self, at: Option<(f32, f32)>)The pointer's position relative to the area, or None when it has left (the window, or the area when following it there).
step
pub fn step(&mut self, dt: f32)Advance by dt seconds (long gaps, such as a hidden tab, count as a tenth of a second).
draw
pub fn draw(&self) -> Vec<DrawCommand>Canvas 2D commands for the current frame: links, then pointer lines, then the particles.