Struct pixel_engine_draw::graphics::DrawingSprite
source · pub struct DrawingSprite<S: DrawSpriteTrait> { /* private fields */ }
Implementations
sourceimpl<S: DrawSpriteTrait> DrawingSprite<S>
impl<S: DrawSpriteTrait> DrawingSprite<S>
Trait Implementations
sourceimpl<S: Clone + DrawSpriteTrait> Clone for DrawingSprite<S>
impl<S: Clone + DrawSpriteTrait> Clone for DrawingSprite<S>
sourcefn clone(&self) -> DrawingSprite<S>
fn clone(&self) -> DrawingSprite<S>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<S: Debug + DrawSpriteTrait> Debug for DrawingSprite<S>
impl<S: Debug + DrawSpriteTrait> Debug for DrawingSprite<S>
sourceimpl<S: DrawSpriteTrait> DrawSpriteTrait for DrawingSprite<S>
impl<S: DrawSpriteTrait> DrawSpriteTrait for DrawingSprite<S>
fn size(&self) -> Vu2d
fn get_pixel(&self, pos: Vi2d) -> Option<Color>
fn set_pixel(&mut self, pos: Vi2d, col: Color)
sourceunsafe fn get_pixel_unchecked(&self, pos: Vu2d) -> Color
unsafe fn get_pixel_unchecked(&self, pos: Vu2d) -> Color
Get the pixel at the given location, but bypassing any bounds check Read more
sourceunsafe fn set_pixel_unchecked(&mut self, pos: Vu2d, col: Color)
unsafe fn set_pixel_unchecked(&mut self, pos: Vu2d, col: Color)
Set the pixel at the given location, but bypassing any bounds check Read more
sourceimpl<S: DrawSpriteTrait> SmartDrawingTrait for DrawingSprite<S>
impl<S: DrawSpriteTrait> SmartDrawingTrait for DrawingSprite<S>
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_textsheet(&self) -> &'static Sprite
fn get_textsheet(&self) -> &'static Sprite
Get The textsheet (A
Sprite
)sourcefn get_pixel_mode(&self) -> PixelMode
fn get_pixel_mode(&self) -> PixelMode
Return the
PixelMode
sourcefn get_blend_factor(&self) -> f32
fn get_blend_factor(&self) -> f32
Get the Blend Factor
Used for alpha calculations Read more
sourcefn set_pixel_mode(&mut self, mode: PixelMode)
fn set_pixel_mode(&mut self, mode: PixelMode)
Set the
PixelMode
sourcefn set_blend_factor(&mut self, f: f32)
fn set_blend_factor(&mut self, f: f32)
Set the Blend Factor
Used for alpha calculations Read more
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> DottedShapeTrait for Twhere
T: SmartDrawingTrait,
impl<T> DottedShapeTrait for Twhere
T: SmartDrawingTrait,
sourcefn 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
sourceimpl<T> ShapesTrait for Twhere
T: SmartDrawingTrait,
impl<T> ShapesTrait for Twhere
T: SmartDrawingTrait,
sourcefn 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 screen Read moresourcefn 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. Read more
sourcefn 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) Read moresourcefn 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) Read moresourcefn 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
sourcefn 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
sourcefn draw_triangle<P: Into<Vi2d>>(&mut self, pts1: P, pts2: P, pts3: P, col: Color)
fn draw_triangle<P: Into<Vi2d>>(&mut self, pts1: P, pts2: P, pts3: P, col: Color)
Draw the edges of a triangle between the three points
sourcefn fill_triangle<P: Into<Vi2d>>(&mut self, pts1: P, pts2: P, pts3: P, col: Color)
fn fill_triangle<P: Into<Vi2d>>(&mut self, pts1: P, pts2: P, pts3: P, col: Color)
Fill the given triangle
sourceimpl<T> SpriteTrait for Twhere
T: SmartDrawingTrait,
impl<T> SpriteTrait for Twhere
T: SmartDrawingTrait,
sourcefn 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) Read moresourcefn 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()
Read more