Skip to content

SpriteSheetObject

Generated from engine/render/sprite_sheet_object.h at f525bc6. 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

Audience: game code.

#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 - so the element handle lives down there. The sheet lives up here because every subclass needs 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;

Resolves nothing and holds no resource table.

SpriteSheetObject(const std::string& sheet_name,
RenderResources* render_resources,
const Colour& colour = Colour::white,
float rotation = 0.0f,
const Vector2F& origin = Vector2F::zero,
SpriteFlip flip = SpriteFlip::none,
float layer_depth = 0.0f);

render_resources is borrowed and must outlive this drawable. The sheet handle is resolved and subsequently read in that same table.

RenderResources* render_resources,
const Colour& colour = Colour::white,
float rotation = 0.0f,
const Vector2F& origin = Vector2F::zero,
SpriteFlip flip = SpriteFlip::none,
float layer_depth = 0.0f);

A sheet already resolved, for a subclass constructor that takes a paired handle (RenderResources::SheetFrame, SheetStrip) and so has no name to resolve. The handle must come from render_resources, whose borrowed-table lifetime is the same as above.

const SpriteSheet* sprite_sheet() const;
void set_sprite_sheet(RenderResources::SpriteSheetHandle sheet);

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 moves its element in the same breath - never on its own. It resolves nothing, and the handle must come from this object's own RenderResources.

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.

No guide or concept page links to this header yet.

Documentation for Labrador v0.4.0. Built from Labrador f525bc6 of 2026-11-17.

All documentation versions