[][src]Struct storm::Sprite

#[repr(C)]
pub struct Sprite {
    pub pos: Vector3<f32>,
    pub size: Vector2<u16>,
    pub texture: Texture,
    pub color: RGBA8,
    pub rotation: u16,
}

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]

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]

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_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]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<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> Borrow<T> for T where
    T: ?Sized
[src]

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

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