[][src]Struct rustbatch::render::sprite::Sprite

pub struct Sprite { /* fields omitted */ }

Sprite is used for drawing images to batch It does not contain any heavy image data. if you check size of sprite its not horribly big and copying it is only right approach its a trade of - copying is slower in order to make drawing faster

Implementations

impl Sprite[src]

pub const PATTERN: [u32; 6][src]

pub const VERTEX_COUNT: usize[src]

pub const VERTEX_SIZE: usize[src]

pub const COLOR_OFFSET: usize[src]

pub fn new(region: Rect) -> Sprite[src]

new returns new sprite. rect is a texture region of texture in sprite-sheet so if you are not using sprite-sheet just pass a bounding rectangle of whole texture

pub fn draw_with_matrix<T: Target>(
    &mut self,
    target: &mut T,
    mat: &Mat,
    color: &RGBA
)
[src]

draw_with_matrix "draws" texture to to batch transformed by given matrix and multiplied by given color

pub fn draw<T: Target>(
    &mut self,
    target: &mut T,
    position: Vect,
    scale: Vect,
    rotation: f32,
    color: &RGBA
)
[src]

draw "draws" texture to to batch

Trait Implementations

impl Clone for Sprite[src]

impl Particle for Sprite[src]

Auto Trait Implementations

impl RefUnwindSafe for Sprite

impl Send for Sprite

impl Sync for Sprite

impl Unpin for Sprite

impl UnwindSafe for Sprite

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,