Skip to content

SpriteFrame

Generated from engine/render/sprite_frame.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.

Browse the render module

#include "engine/render/sprite_frame.h" · namespace labrador

One named rectangle inside a sprite sheet, and the pivot the sheet authored for it.

THERE IS NO rotated HERE. A packer can store a frame turned ninety degrees to pack it tighter, and the sheet schema has a key saying so; engine/assets/sprite_sheet_loader.cpp refuses such a frame by name, which is the whole of the engine's position on packer rotation. A capability the engine does not have has nowhere to be stored, or the next person to want it finds the field already there and fills it in rather than arguing for the feature.

SpriteFrame() = default;
explicit SpriteFrame(const mattmath::RectangleI& source_rectangle,
const mattmath::Vector2F& origin =
SpriteFrame(const mattmath::Vector2F& position,
const mattmath::Vector2F& size,
const mattmath::Vector2F& origin =
mattmath::Vector2F::ZERO);
const mattmath::RectangleI& source_rectangle() const;

A RectangleI, and not a RECT*. Handing out a pointer means keeping both forms of the same rectangle for a stable address to return, and the two can drift. The seam takes a RectangleI, so there is no duplicate and the conversion happens once, in the backend.

const mattmath::Vector2F& origin() const;

The pivot the sheet authored, in unscaled source texels measured from this frame's top left - the seam's own units for an origin (engine/render/sprite_geometry.h), so nothing converts on the way to a quad. Zero for a frame whose definition does not mention one, which is most of them and is why the default draws from the top left.

It is not a term of the draw on its own: SpriteSheet::draw adds it to whatever origin the caller passed, and that file says why the two compose rather than one replacing the other.

Named in the public declarations above: RectangleI, Vector2F.

The files that include this header directly. A file can also reach it through another header.

Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.