Trait pixel_engine_draw::traits::SmartDrawingTrait
source · pub trait SmartDrawingTrait: DrawSpriteTrait {
fn get_size(&self) -> Vu2d;
fn get_textsheet(&self) -> &'static Sprite;
fn clear(&mut self, col: Color);
fn draw<P: Into<Vi2d>>(&mut self, pos: P, col: Color);
fn get_pixel<P: Into<Vi2d>>(&self, pos: P) -> Option<Color>;
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§
sourcefn get_textsheet(&self) -> &'static Sprite
fn get_textsheet(&self) -> &'static Sprite
Get The textsheet (A Sprite
)
sourcefn draw<P: Into<Vi2d>>(&mut self, pos: P, col: Color)
fn draw<P: Into<Vi2d>>(&mut self, pos: P, col: Color)
Set the pixel data at the given coordinates to the given Color
Will use the current PixelMode
sourcefn get_pixel<P: Into<Vi2d>>(&self, pos: P) -> Option<Color>
fn get_pixel<P: Into<Vi2d>>(&self, pos: P) -> Option<Color>
Get the Pixel Data at the given coordinates
sourcefn get_pixel_mode(&self) -> PixelMode
fn get_pixel_mode(&self) -> PixelMode
Return the PixelMode
sourcefn set_pixel_mode(&mut self, mode: PixelMode)
fn set_pixel_mode(&mut self, mode: PixelMode)
Set the PixelMode
sourcefn get_blend_factor(&self) -> f32
fn get_blend_factor(&self) -> f32
Get the Blend Factor Used for alpha calculations
sourcefn set_blend_factor(&mut self, f: f32)
fn set_blend_factor(&mut self, f: f32)
Set the Blend Factor Used for alpha calculations