Struct pixel_engine::graphics::DrawingSprite
source · pub struct DrawingSprite<S>where
S: DrawSpriteTrait,{ /* private fields */ }
Implementations§
source§impl<S> DrawingSprite<S>where
S: DrawSpriteTrait,
impl<S> DrawingSprite<S>where
S: DrawSpriteTrait,
Trait Implementations§
source§impl<S> Clone for DrawingSprite<S>where
S: Clone + DrawSpriteTrait,
impl<S> Clone for DrawingSprite<S>where
S: Clone + DrawSpriteTrait,
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 for DrawingSprite<S>where
S: Debug + DrawSpriteTrait,
impl<S> Debug for DrawingSprite<S>where
S: Debug + DrawSpriteTrait,
source§impl<S> DrawSpriteTrait for DrawingSprite<S>where
S: DrawSpriteTrait,
impl<S> DrawSpriteTrait for DrawingSprite<S>where
S: DrawSpriteTrait,
fn size(&self) -> Vec2d<u32>
fn get_pixel(&self, pos: Vec2d<i32>) -> Option<Color>
fn set_pixel(&mut self, pos: Vec2d<i32>, col: Color)
source§impl<S> SmartDrawingTrait for DrawingSprite<S>where
S: DrawSpriteTrait,
impl<S> SmartDrawingTrait for DrawingSprite<S>where
S: DrawSpriteTrait,
source§fn 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
source§fn draw<P>(&mut self, pos: P, col: Color)where
P: Into<Vec2d<i32>>,
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_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>(&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
source§impl<T> ShapesTrait for Twhere
T: SmartDrawingTrait,
impl<T> ShapesTrait for Twhere
T: SmartDrawingTrait,
source§fn 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 screensource§fn 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.
source§fn 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)source§fn 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)source§fn 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
source§fn 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
source§impl<T> SpriteTrait for Twhere
T: SmartDrawingTrait,
impl<T> SpriteTrait for Twhere
T: SmartDrawingTrait,
source§fn 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)source§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>>,
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()