kludgine

Trait DrawableExt

Source
pub trait DrawableExt<Source, Unit> {
    // Required methods
    fn translate_by(self, point: Point<Unit>) -> Drawable<Source, Unit>;
    fn rotate_by(self, angle: Angle) -> Drawable<Source, Unit>;
    fn scale(self, factor: impl ScaleFactor) -> Drawable<Source, Unit>;
    fn opacity(self, opacity: f32) -> Drawable<Source, Unit>;
}
Expand description

Translation, rotation, and scaling for drawable types.

Required Methods§

Source

fn translate_by(self, point: Point<Unit>) -> Drawable<Source, Unit>

Translates self by point.

Source

fn rotate_by(self, angle: Angle) -> Drawable<Source, Unit>

Rotates self by angle.

Source

fn scale(self, factor: impl ScaleFactor) -> Drawable<Source, Unit>

Scales self by factor.

Source

fn opacity(self, opacity: f32) -> Drawable<Source, Unit>

Renders this drawable with opacity, ranged from 0.- to 1.0.

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§

Source§

impl<T, Unit> DrawableExt<T, Unit> for Drawable<T, Unit>

Source§

impl<T, Unit> DrawableExt<T, Unit> for T
where Drawable<T, Unit>: From<T>, Unit: Default,