Struct lux::graphics::ContainedSprite [] [src]

#[must_use = "Sprites only contain context, and must be drawn with `draw()`"]
pub struct ContainedSprite<'a, C: 'a> {
    // some fields omitted
}

A sprite that can be drawn to the screen.

Methods

impl<'a, C> ContainedSprite<'a, C> where C: Canvas + 'a

fn size(&mut self, w: Float, h: Float) -> &mut ContainedSprite<'a, C>

Sets the side of the sprite when drawn to the screen.

The default size is the "ideal size", that is, 1 pixel in the texture goes to 1 pixel on the screen.

fn draw(&mut self)

Draws the sprite to the screen.

Trait Implementations

impl<'a, C> Colored for ContainedSprite<'a, C>

fn get_color(&self) -> [Float; 4]

fn color<A: Color>(&mut self, color: A) -> &mut Self

fn with_color<F, C: Color>(&mut self, color: C, f: F) where F: FnOnce(&mut Self)