Skip to main content

Renderable

Trait Renderable 

Source
pub trait Renderable {
    // Required method
    fn draw(&self, context: &CanvasRenderingContext2d, transform: &Transform2D);
}
Expand description

A trait for objects that can be rendered onto a canvas.

Required Methods§

Source

fn draw(&self, context: &CanvasRenderingContext2d, transform: &Transform2D)

Draws this object onto the given canvas rendering context.

§Arguments
  • &CanvasRenderingContext2d - The canvas 2D rendering context.
  • &Transform2D - The world-space transform to apply.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§