DynamicDrawable

Trait DynamicDrawable 

Source
pub trait DynamicDrawable<const N: usize> {
    // Required methods
    fn draw<T: DynamicCanvas<S>, S: Pixel>(&self, display: &mut T, value: S::U)
       where [(); { _ }]:;
    fn transform<F: Fn((f32, f32)) -> (f32, f32)>(&self, transform: F) -> Self;
}
Expand description

Defines an object that can be drawn onto a canvas.

Required Methods§

Source

fn draw<T: DynamicCanvas<S>, S: Pixel>(&self, display: &mut T, value: S::U)
where [(); { _ }]:,

Draws the drawable onto a canvas with the specified pixel type/brush.

Source

fn transform<F: Fn((f32, f32)) -> (f32, f32)>(&self, transform: F) -> Self

Transforms the drawable by applying a function to all coordinate pairs that define it. Returns a new transformed drawable.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§