Module pix_engine::draw [−][src]
Expand description
Drawing methods.
Provides a Draw trait as well standard draw methods.
Provided PixState
methods:
PixState::clear
: Clear the render target to the current background Color.PixState::save_canvas
: Save the current render target out to a png file.
Example
fn on_update(&mut self, s: &mut PixState) -> PixResult<()> {
s.background(Color::ALICE_BLUE);
s.clear();
let rect = rect![0, 0, 100, 100];
s.fill(Color::RED);
s.stroke(Color::BLACK);
s.rect(rect)?;
Ok(())
}
Traits
Trait for objects that can be drawn to the screen.