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§
Sourcefn draw_on_canvas(&self, canvas: &mut Canvas)
fn draw_on_canvas(&self, canvas: &mut Canvas)
This method is called by the draw method.