Reading a sprite sheet
Generated from engine/assets/sprite_sheet_loader.h at 862e08b. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
#include "engine/assets/sprite_sheet_loader.h" · namespace labrador
read_sprite_sheet
Section titled “read_sprite_sheet” TextureHandle texture);Reads the sheet definition at json_path and builds a SpriteSheet drawing from texture. The frame and animation-strip tables are decoded here rather than by SpriteSheet itself, so that nothing on the draw path compiles a JSON parser to draw a sprite.
Throws std::runtime_error naming the path if the file cannot be read or parsed, and naming the path and the offending frame or strip if the document is the wrong shape (T6).
AND FOR ONE THING THE DOCUMENT CAN SAY THAT IS WELL FORMED AND STILL NOT DRAWABLE: a frame with "rotated": true is refused here, by name, rather than loaded and then drawn upright. A sheet is authored content, so a key the engine reads and disagrees with is a worse failure than one it rejects - the .cpp carries the argument, and engine/render/sprite_frame.h is why there is no member to hold the answer.
origin goes the other way: it is honoured, because it costs one addition on a path that already carries an origin (engine/render/sprite_sheet.h).
Related types
Section titled “Related types”Named in the public declarations above: SpriteSheet.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
tests/assets/sprite_sheet_loader_tests.cpp
Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.