Struct pixel_engine::graphics::DrawingSprite
source · pub struct DrawingSprite<S>where
S: DrawSpriteTrait,{ /* private fields */ }
Implementations
sourceimpl<S> DrawingSprite<S>where
S: DrawSpriteTrait,
impl<S> DrawingSprite<S>where
S: DrawSpriteTrait,
Trait Implementations
sourceimpl<S> Clone for DrawingSprite<S>where
S: Clone + DrawSpriteTrait,
impl<S> Clone for DrawingSprite<S>where
S: Clone + DrawSpriteTrait,
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 for DrawingSprite<S>where
S: Debug + DrawSpriteTrait,
impl<S> Debug for DrawingSprite<S>where
S: Debug + DrawSpriteTrait,
sourceimpl<S> DrawSpriteTrait for DrawingSprite<S>where
S: DrawSpriteTrait,
impl<S> DrawSpriteTrait for DrawingSprite<S>where
S: DrawSpriteTrait,
sourceimpl<S> SmartDrawingTrait for DrawingSprite<S>where
S: DrawSpriteTrait,
impl<S> SmartDrawingTrait for DrawingSprite<S>where
S: DrawSpriteTrait,
sourcefn get_pixel<P>(&self, pos: P) -> Option<Color>where
P: Into<Vec2d<i32>>,
fn get_pixel<P>(&self, pos: P) -> Option<Color>where
P: Into<Vec2d<i32>>,
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>(&mut self, p1: P, p2: P, col: Color, pattern: u32)where
P: Into<Vec2d<i32>>,
fn draw_line_dotted<P>(&mut self, p1: P, p2: P, col: Color, pattern: u32)where
P: Into<Vec2d<i32>>,
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>(&mut self, pos: P, scale: u32, col: Color, text: &str)where
P: Into<Vec2d<i32>>,
fn draw_text<P>(&mut self, pos: P, scale: u32, col: Color, text: &str)where
P: Into<Vec2d<i32>>,
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>(&mut self, p1: P, p2: P, col: Color)where
P: Into<Vec2d<i32>>,
fn draw_line<P>(&mut self, p1: P, p2: P, col: Color)where
P: Into<Vec2d<i32>>,
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>(&mut self, pos: P, size: P, col: Color)where
P: Into<Vec2d<i32>>,
fn draw_rect<P>(&mut self, pos: P, size: P, col: Color)where
P: Into<Vec2d<i32>>,
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>(&mut self, pos: P, size: P, col: Color)where
P: Into<Vec2d<i32>>,
fn fill_rect<P>(&mut self, pos: P, size: P, col: Color)where
P: Into<Vec2d<i32>>,
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>(&mut self, pos: P, r: u32, col: Color)where
P: Into<Vec2d<i32>>,
fn draw_circle<P>(&mut self, pos: P, r: u32, col: Color)where
P: Into<Vec2d<i32>>,
Draw a circle with center
(x, y)
and raduis r
sourcefn fill_circle<P>(&mut self, pos: P, r: u32, col: Color)where
P: Into<Vec2d<i32>>,
fn fill_circle<P>(&mut self, pos: P, r: u32, col: Color)where
P: Into<Vec2d<i32>>,
Fill a circle with center
(x, y)
and raduis r
sourceimpl<T> SpriteTrait for Twhere
T: SmartDrawingTrait,
impl<T> SpriteTrait for Twhere
T: SmartDrawingTrait,
sourcefn draw_sprite<P>(
&mut self,
pos: P,
scale: u32,
sprite: &Sprite,
flip: (bool, bool)
)where
P: Into<Vec2d<i32>>,
fn draw_sprite<P>(
&mut self,
pos: P,
scale: u32,
sprite: &Sprite,
flip: (bool, bool)
)where
P: Into<Vec2d<i32>>,
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>(
&mut self,
coords: P,
sprite: &Sprite,
o: P,
size: P,
scale: u32,
flip: (bool, bool)
)where
P: Into<Vec2d<i32>>,
fn draw_partial_sprite<P>(
&mut self,
coords: P,
sprite: &Sprite,
o: P,
size: P,
scale: u32,
flip: (bool, bool)
)where
P: Into<Vec2d<i32>>,
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