[][src]Struct vxdraw::strtex::Sprite

pub struct Sprite { /* fields omitted */ }

Sprite creation builder

A sprite is a rectangular view into a texture. This structure sets up the necessary data to call Strtex::add with.

Methods

impl Sprite[src]

pub fn new() -> Self[src]

Same as default

pub fn width(self, width: f32) -> Self[src]

Set the width of the sprite

pub fn height(self, height: f32) -> Self[src]

Set the height of the sprite

pub fn opacity(self, opacity: u8) -> Self[src]

Set the colors of the sprite

The colors are added on top of whatever the sprite's texture data is

pub fn uv_begin(self, uv: (f32, f32)) -> Self[src]

Set the topleft corner's UV coordinates

pub fn uv_end(self, uv: (f32, f32)) -> Self[src]

Set the bottom right corner's UV coordinates

pub fn translation(self, trn: (f32, f32)) -> Self[src]

Set the translation

pub fn rotation<T: Copy + Into<Rad<f32>>>(self, angle: T) -> Self[src]

Set the rotation. Rotation is counter-clockwise

pub fn scale(self, scale: f32) -> Self[src]

Set the scaling factor of this sprite

pub fn origin(self, origin: (f32, f32)) -> Self[src]

Set the origin of this sprite

Trait Implementations

impl Default for Sprite[src]

impl Clone for Sprite[src]

impl Copy for Sprite[src]

Auto Trait Implementations

impl Unpin for Sprite

impl Sync for Sprite

impl Send for Sprite

impl UnwindSafe for Sprite

impl RefUnwindSafe for Sprite

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

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

impl<T> SetParameter for T

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