[][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 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(&mut self, batch: &mut Batch, mat: &Mat, color: &RGBA)[src]

draw "draws" texture to to batch. All it does is that it appends its vertex data transformed by provided matrix and colored by provides color.

Trait Implementations

impl Clone 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> Any for T where
    T: Any
[src]

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

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

impl<T> CloneAny for T where
    T: Clone + Any
[src]

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

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

impl<T> SetParameter for T

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>,