[−][src]Struct storm::Sprite
Configuration settings for a sprite.
Fields
pos: Vector3<f32>
Position of the sprite. The X and Y coordinates represent the bottom left corner of the sprite. The Z coordinate represents sprite depth. Units are measured in pixels.
size: Vector2<u16>
Units are measured in pixels.
texture: Texture
Texture to apply to the sprite. The default is a plain white texture.
color: RGBA8
Color multiplier to apply to the sprite. The default is white.
rotation: u16
Rotation of the sprite. Units are 1/65536th of a turn.
Methods
impl Sprite
[src]
pub fn new(
pos: Vector3<f32>,
size: Vector2<f32>,
texture: Texture,
color: RGBA8,
rotation: f32
) -> Sprite
[src]
pos: Vector3<f32>,
size: Vector2<f32>,
texture: Texture,
color: RGBA8,
rotation: f32
) -> Sprite
Creates aa new sprite. This converts the rotation and size from floats automatically. Size is measured in pixels, and is limited to 65535. Rotation is measured in turns from [0, 1). Values outside of the range are wrapped into the range. For example, 1.75 is wrapped into 0.75, -0.4 is wrapped into 0.6.
pub fn new_raw(
pos: Vector3<f32>,
size: Vector2<u16>,
texture: Texture,
color: RGBA8,
rotation: u16
) -> Sprite
[src]
pos: Vector3<f32>,
size: Vector2<u16>,
texture: Texture,
color: RGBA8,
rotation: u16
) -> Sprite
Creates a new sprite. This does not conversions and represents exactly the members of the sprite type.
Trait Implementations
impl Clone for Sprite
[src]
fn clone(&self) -> Sprite
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Sprite
[src]
impl Copy for Sprite
[src]
impl Debug for Sprite
[src]
Auto Trait Implementations
impl Unpin for Sprite
impl Sync for Sprite
impl Send for Sprite
impl RefUnwindSafe for Sprite
impl UnwindSafe for Sprite
Blanket Implementations
impl<T> From<T> for T
[src]
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, 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> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,