Trait SmartDrawingTrait

Source
pub trait SmartDrawingTrait: DrawSpriteTrait {
    // Required methods
    fn get_size(&self) -> Vec2d<u32>;
    fn get_textsheet(&self) -> &'static Sprite;
    fn clear(&mut self, col: Color);
    fn draw<P>(&mut self, pos: P, col: Color)
       where P: Into<Vec2d<i32>>;
    fn get_pixel<P>(&self, pos: P) -> Option<Color>
       where P: Into<Vec2d<i32>>;
    fn get_pixel_mode(&self) -> PixelMode;
    fn set_pixel_mode(&mut self, mode: PixelMode);
    fn get_blend_factor(&self) -> f32;
    fn set_blend_factor(&mut self, f: f32);
}
Expand description

The Basic Drawing Trait All that is needed to draw one pixel one the target

Required Methods§

Source

fn get_size(&self) -> Vec2d<u32>

Get the size of the target

Source

fn get_textsheet(&self) -> &'static Sprite

Get The textsheet (A Sprite)

Source

fn clear(&mut self, col: Color)

Clear the Sprite With the given Color

Source

fn draw<P>(&mut self, pos: P, col: Color)
where P: Into<Vec2d<i32>>,

Set the pixel data at the given coordinates to the given Color Will use the current PixelMode

Source

fn get_pixel<P>(&self, pos: P) -> Option<Color>
where P: Into<Vec2d<i32>>,

Get the Pixel Data at the given coordinates

Source

fn get_pixel_mode(&self) -> PixelMode

Return the PixelMode

Source

fn set_pixel_mode(&mut self, mode: PixelMode)

Set the PixelMode

Source

fn get_blend_factor(&self) -> f32

Get the Blend Factor Used for alpha calculations

Source

fn set_blend_factor(&mut self, f: f32)

Set the Blend Factor Used for alpha calculations

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§