Skip to main content

Module sprite_cache

Module sprite_cache 

Source
Expand description

Decoded sprite cache: sprite sheet decoding, tile extraction, and runtime lookup.

The SpriteCache is built from TilesetOptions and provides O(1) lookup of decoded RGBA8 sprites by codepoint.

Structs§

Sprite
A decoded, ready-to-blit sprite.
SpriteCache
Cache of decoded sprites, keyed by Unicode codepoint.
SpriteTint
The complete recolouring one sprite goes through in one cell: the sheet’s own treatment, then the cell’s tint.

Functions§

warn_sprite_needs_span
Warns, at most once per glyph, that glyph’s sprite is larger than one cell but was drawn without a span reserving the cells it covers.
warn_tint_needs_sprite
Warns, at most once per glyph, that glyph carries a tint but resolved to a bitmap font glyph rather than a sprite, so the tint was silently dropped.