Struct radiant_rs::Sprite [] [src]

pub struct Sprite { /* fields omitted */ }

A sprite used for drawing on a Layer.

Sprites are created from spritesheets containing one or more frames. To determine frame dimensions, Sprite::from_file() expects sprite sheet file names to follow a specific pattern. (Future versions will add more configurable means to load sprites.)

Methods

impl<'a> Sprite
[src]

[src]

Creates a new sprite texture. Given filename is expected to end on _xx., e.g. asteroid_64x64x24.png.

[src]

Creates a new sprite texture.

Important traits for &'a mut W
[src]

Draws a sprite onto the given layer.

Important traits for &'a mut W
[src]

Draws a sprite onto the given layer and applies given color, rotation and scaling.

Important traits for &'a mut W
[src]

Defines the sprite origin. Defaults to (0.5, 0.5), meaning that the center of the sprite would be drawn at the coordinates given to Sprite::draw(). Likewise, (0.0, 0.0) would mean that the sprite's top left corner would be drawn at the given coordinates.

[src]

Returns the width of the sprite.

[src]

Returns the height of the sprite.

[src]

Returns the number of frames of the sprite.

[src]

Returns the sprite wrapped in an std::Arc

Trait Implementations

impl Clone for Sprite
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Sprite
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Sprite

impl Sync for Sprite