[−][src]Struct rustbatch::render::sprite::Sprite
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]
&mut self,
target: &mut T,
mat: &Mat,
color: &RGBA
)
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]
&mut self,
target: &mut T,
position: Vect,
scale: Vect,
rotation: f32,
color: &RGBA
)
draw "draws" texture to to batch
Trait Implementations
impl Clone for Sprite
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,