Drawable

Trait Drawable 

Source
pub trait Drawable {
    // Required method
    fn draw_on_canvas(&self, canvas: &mut Canvas);
}
Expand description

This trait allows an object to be drawn on a canvas like this:

canvas.draw(&object);

If you are experienced with html5 canvas element you can get the WebSys canvas object and draw on it directly.

Required Methods§

Source

fn draw_on_canvas(&self, canvas: &mut Canvas)

This method is called by the draw method.

Implementors§

Source§

impl Drawable for Line

Source§

impl Drawable for Rectangle

Source§

impl<'a> Drawable for Text<'a>

Source§

impl<'a, T: Into<f64> + Copy + AddAssign> Drawable for Sprite<'a, T>