[][src]Trait wasm_game_lib::graphics::drawable::Drawable

pub trait Drawable {
    fn draw_on_canvas(&self, canvas: &mut Canvas);
}

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

This example is not tested
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

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

This method is called by the draw method.

Loading content...

Implementors

impl Drawable for Line[src]

impl Drawable for Rectangle[src]

impl<'a> Drawable for Text<'a>[src]

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

Loading content...