[−][src]Struct vxdraw::strtex::Sprite
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
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]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Supports<T> for T
[src]
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,