Trait pixel_engine_draw::traits::SpriteTrait[][src]

pub trait SpriteTrait: ScreenTrait {
    fn draw_sprite<P: Into<Vu2d>>(
        &mut self,
        pos: P,
        scale: u32,
        sprite: &Sprite,
        flip: (bool, bool)
    ) { ... }
fn draw_partial_sprite<P: Into<Vu2d>>(
        &mut self,
        coords: P,
        sprite: &Sprite,
        o: P,
        size: P,
        scale: u32,
        flip: (bool, bool)
    ) { ... } }

A trait that will handle the drawing of Sprite onto the Target

Provided methods

fn draw_sprite<P: Into<Vu2d>>(
    &mut self,
    pos: P,
    scale: u32,
    sprite: &Sprite,
    flip: (bool, bool)
)
[src]

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<P: Into<Vu2d>>(
    &mut self,
    coords: P,
    sprite: &Sprite,
    o: P,
    size: P,
    scale: u32,
    flip: (bool, bool)
)
[src]

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()

Loading content...

Implementors

Loading content...