pub struct SpriteDraw {
pub texture: Handle<Texture>,
pub uv: Rect,
pub position: Vec2,
pub size: Vec2,
pub pivot: Vec2,
pub rotation: f32,
pub color: Color,
pub layer: u8,
pub sort: SortMode,
pub flip: Flip,
}Expand description
One sprite to draw in the world.
Fields§
§texture: Handle<Texture>The texture, usually an atlas page.
uv: RectThe region of the texture, normalized: (0, 0) to (1, 1) is all of it. A texture that failed to load shows all of its placeholder instead.
position: Vec2Where the pivot is in the world.
size: Vec2The size in world units.
pivot: Vec2The point of the sprite at position, normalized: (0.5, 1) is the
middle of its bottom edge, its feet.
rotation: f32Radians, clockwise on screen, about the pivot.
color: ColorA tint, sRGB, multiplied with the texture in linear light.
layer: u8Higher layers are drawn in front of lower ones.
sort: SortModeHow it is ordered within its layer.
flip: FlipWhich way it is mirrored, about its pivot, so that a trimmed frame mirrors as its untrimmed cell would: one whose pivot is in the middle of its width mirrors in place left to right, and one with its pivot at its feet hangs below them when mirrored top to bottom.