[][src]Struct a2d::SpriteSheet

pub struct SpriteSheet { /* fields omitted */ }

An image loaded in GPU memory ready to be used with a SpriteBatch

Implementations

impl SpriteSheet[src]

pub fn from_bytes(
    state: &mut Graphics2D,
    diffuse_bytes: &[u8]
) -> Result<Rc<Self>>
[src]

Creates a sprite sheet from image bytes

The bytes are interpreted by passing the bytes to the load_from_memory function from the image crate

pub fn from_color<C: Into<Color>>(
    state: &mut Graphics2D,
    color: C
) -> Result<Rc<Self>>
[src]

pub fn from_colors<C, V>(
    state: &mut Graphics2D,
    width: u32,
    height: u32,
    colors: V
) -> Result<Rc<Self>> where
    C: Into<Color>,
    V: IntoIterator<Item = C>, 
[src]

pub fn from_rgba_bytes(
    state: &mut Graphics2D,
    width: u32,
    height: u32,
    bytes: Vec<u8>
) -> Result<Rc<Self>>
[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> SetParameter for T

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.