Skip to content

SpriteSheetObject

Generated from engine/render/sprite_sheet_object.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_sheet_object.h" · namespace labrador

A drawable that draws out of one sprite sheet.

It holds a handle to that sheet, not its name. The name is resolved once, here in the constructor, because holding the name means a std::map<std::string, ...> descent per draw, per drawable, from every render worker at once (PHILOSOPHY T7, T8).

What a sheet *element* is depends on the subclass - a frame for TextureObject, an animation strip for AnimationObject - so the element handle lives down there. The sheet lives up here because both need it and because an element handle only means anything against the sheet it was resolved from. Those two therefore change together: see set_sprite_sheet.

SpriteSheetObject() = default;
SpriteSheetObject(const std::string& sheet_name,
RenderResources* render_resources,
const Colour& color = Colour::white,
float rotation = 0.0f,
SpriteFlip flip = SpriteFlip::none,
float layer_depth = 0.0f);
const SpriteSheet* sprite_sheet() const;
void set_sprite_sheet(const std::string& sheet_name);

Re-points this object at another sheet. Every element handle a subclass is holding refers to the old sheet and is meaningless against the new one, so a subclass calls this only from a setter that re-resolves its element in the same breath - never on its own.

Named in the public declarations above: Colour, DrawObject, RenderResources, SpriteFlip, SpriteSheet, 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.