Skip to main content

euv_engine/renderer/
trait.rs

1use crate::*;
2
3/// A trait for objects that can be rendered onto a canvas.
4pub trait Renderable {
5    /// Draws this object onto the given canvas rendering context.
6    ///
7    /// # Arguments
8    ///
9    /// - `&CanvasRenderingContext2d` - The canvas 2D rendering context.
10    /// - `&Transform2D` - The world-space transform to apply.
11    fn draw(&self, context: &CanvasRenderingContext2d, transform: &Transform2D);
12}