[−][src]Trait pixel_engine::traits::SpriteTrait
A trait that will handle the drawing of Sprite onto the Target
Provided methods
fn draw_sprite(
&mut self,
x: u32,
y: u32,
scale: u32,
sprite: &Sprite,
flip: (bool, bool)
)
&mut self,
x: u32,
y: u32,
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)
fn draw_partial_sprite(
&mut self,
coords: (u32, u32),
sprite: &Sprite,
o: (u32, u32),
size: (u32, u32),
scale: u32,
flip: (bool, bool)
)
&mut self,
coords: (u32, u32),
sprite: &Sprite,
o: (u32, u32),
size: (u32, u32),
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()
]
Implementors
impl<T> SpriteTrait for T where
T: ScreenTrait,
[src]
T: ScreenTrait,