Struct pixel_engine_draw::graphics::DrawingSprite
source · pub struct DrawingSprite<S: DrawSpriteTrait> { /* private fields */ }
Implementations§
source§impl<S: DrawSpriteTrait> DrawingSprite<S>
impl<S: DrawSpriteTrait> DrawingSprite<S>
Trait Implementations§
source§impl<S: Clone + DrawSpriteTrait> Clone for DrawingSprite<S>
impl<S: Clone + DrawSpriteTrait> Clone for DrawingSprite<S>
source§fn clone(&self) -> DrawingSprite<S>
fn clone(&self) -> DrawingSprite<S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<S: Debug + DrawSpriteTrait> Debug for DrawingSprite<S>
impl<S: Debug + DrawSpriteTrait> Debug for DrawingSprite<S>
source§impl<S: DrawSpriteTrait> DrawSpriteTrait for DrawingSprite<S>
impl<S: DrawSpriteTrait> DrawSpriteTrait for DrawingSprite<S>
source§impl<S: DrawSpriteTrait> SmartDrawingTrait for DrawingSprite<S>
impl<S: DrawSpriteTrait> SmartDrawingTrait for DrawingSprite<S>
source§fn 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
source§fn 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
source§fn get_textsheet(&self) -> &'static Sprite
fn get_textsheet(&self) -> &'static Sprite
Get The textsheet (A
Sprite
)source§fn get_pixel_mode(&self) -> PixelMode
fn get_pixel_mode(&self) -> PixelMode
Return the
PixelMode
source§fn get_blend_factor(&self) -> f32
fn get_blend_factor(&self) -> f32
Get the Blend Factor
Used for alpha calculations
source§fn set_pixel_mode(&mut self, mode: PixelMode)
fn set_pixel_mode(&mut self, mode: PixelMode)
Set the
PixelMode
source§fn set_blend_factor(&mut self, f: f32)
fn set_blend_factor(&mut self, f: f32)
Set the Blend Factor
Used for alpha calculations
Auto Trait Implementations§
impl<S> RefUnwindSafe for DrawingSprite<S>where
S: RefUnwindSafe,
impl<S> Send for DrawingSprite<S>where
S: Send,
impl<S> Sync for DrawingSprite<S>where
S: Sync,
impl<S> Unpin for DrawingSprite<S>where
S: Unpin,
impl<S> UnwindSafe for DrawingSprite<S>where
S: UnwindSafe,
Blanket Implementations§
source§impl<T> DottedShapeTrait for Twhere
T: SmartDrawingTrait,
impl<T> DottedShapeTrait for Twhere
T: SmartDrawingTrait,
source§fn draw_line_dotted<P: Into<Vi2d>>(
&mut self,
p1: P,
p2: P,
col: Color,
pattern: u32
)
fn draw_line_dotted<P: Into<Vi2d>>(
&mut self,
p1: P,
p2: P,
col: Color,
pattern: u32
)
Draw a dotted line
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ShapesTrait for Twhere
T: SmartDrawingTrait,
impl<T> ShapesTrait for Twhere
T: SmartDrawingTrait,
source§fn draw_text<P: Into<Vi2d>>(&mut self, pos: P, scale: u32, col: Color, text: &str)
fn draw_text<P: Into<Vi2d>>(&mut self, pos: P, scale: u32, col: Color, text: &str)
Draw text to the screen
scale
must be >= 1
The textsize will be equal to scale * 8
for the height and scale * 8 * text.len()
for
the width
This will handle \n
treating it as a new line, but wont do any newline stuff if it is
drawing out of the screensource§fn draw_line<P: Into<Vi2d>>(&mut self, p1: P, p2: P, col: Color)
fn draw_line<P: Into<Vi2d>>(&mut self, p1: P, p2: P, col: Color)
Draw a line between two points,
You don’t need to do anything with the points for it to work, it will swap them it needed.
source§fn draw_rect<P: Into<Vi2d>>(&mut self, pos: P, size: P, col: Color)
fn draw_rect<P: Into<Vi2d>>(&mut self, pos: P, size: P, col: Color)
Draw a rectangle with the top left corner at
(x, y)
and the bottom right corner at (x + w, y + h)
(both inclusive)source§fn fill_rect<P: Into<Vi2d>>(&mut self, pos: P, size: P, col: Color)
fn fill_rect<P: Into<Vi2d>>(&mut self, pos: P, size: P, col: Color)
Fill a rectangle with the top left corner at
(x, y)
and the bottom right corner at (x + w, y + h)
(both inclusive)source§fn draw_circle<P: Into<Vi2d>>(&mut self, pos: P, r: u32, col: Color)
fn draw_circle<P: Into<Vi2d>>(&mut self, pos: P, r: u32, col: Color)
Draw a circle with center
(x, y)
and raduis r
source§fn fill_circle<P: Into<Vi2d>>(&mut self, pos: P, r: u32, col: Color)
fn fill_circle<P: Into<Vi2d>>(&mut self, pos: P, r: u32, col: Color)
Fill a circle with center
(x, y)
and raduis r
source§impl<T> SpriteTrait for Twhere
T: SmartDrawingTrait,
impl<T> SpriteTrait for Twhere
T: SmartDrawingTrait,
source§fn draw_sprite<P: Into<Vi2d>>(
&mut self,
pos: P,
scale: u32,
sprite: &Sprite,
flip: (bool, bool)
)
fn draw_sprite<P: Into<Vi2d>>(
&mut self,
pos: P,
scale: u32,
sprite: &Sprite,
flip: (bool, bool)
)
Draw a Sprite with the top left corner at
(x, y)
the flip arguement will allow fliping of the axis
flip: (horizontal, vertical)
scale is the scale of the result (must be >= 1)source§fn draw_partial_sprite<P: Into<Vi2d>>(
&mut self,
coords: P,
sprite: &Sprite,
o: P,
size: P,
scale: u32,
flip: (bool, bool)
)
fn draw_partial_sprite<P: Into<Vi2d>>(
&mut self,
coords: P,
sprite: &Sprite,
o: P,
size: P,
scale: u32,
flip: (bool, bool)
)
Draw a chunk of the given
Sprite
onto the Target
coords
is the top left corner of the Target
o
is the Top left corner of the Sprite Chunk
and size
is the (width, height)
of the chunk
flip
and scale
is the same as SpriteTrait::draw_sprite()