pub struct AtlasSprite {
    pub index: usize,
    pub atlas: Handle<Atlas>,
    pub flip_x: bool,
    pub flip_y: bool,
}
Expand description

An animated sprite component.

Represents one or more Atlass stacked on top of each other, and possibly animated through a range of frames out of the atlas.

Fields§

§index: usize

This is the current index in the animation, with an idx of 0 meaning that the index in the sprite sheet will be start.

If the idx is greater than end - start, then the animation will loop around.

§atlas: Handle<Atlas>

The atlas handle.

§flip_x: bool

Whether or not the flip the sprite horizontally.

§flip_y: bool

Whether or not the flip the sprite vertically.

Implementations§

Create a new AtlasSprite from the given atlas handle.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The type’s Ulid.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Drop the value at ptr. Read more
Clone the value at src, writing the new value to dst. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.