Sprite
:= {
texture : Texture,
source : Rect,
pos : Vec2,
origin : Vec2,
rotation : F32,
scale : Vec2,
tint : Color,
}
Sprite module - pure helpers for texture sprites and simple animations.
Drawing still goes through Draw/Assets. This module provides a compact game-facing shape for sprites, spritesheet frame rectangles, and animation state.
centered : Sprite -> Sprite
to_texture_draw : Sprite -> TextureDraw
draw! : Sprite => { }
from_texture : Texture -> Sprite
with_source : Sprite, Rect -> Sprite
with_origin : Sprite, Vec2 -> Sprite
with_origin_center : Sprite -> Sprite
with_rotation : Sprite, F32 -> Sprite
with_scale_xy : Sprite, Vec2 -> Sprite
with_scale : Sprite, F32 -> Sprite
sheet_frame : { frame_size : Vec2, row : U64, col : U64 } -> Rect
Return a source rectangle for a regular grid spritesheet.
animation_source : Animation, { frame_size : Vec2, row : U64 } -> Rect