Skip to content

AnimationObject

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

A playing animation out of a sprite sheet.

Like TextureObject, the element name is resolved once and kept as a handle - and it matters more here, because the strip is read on the update path as well as the draw path: once for the frame advance, again for the source rectangle, every frame, for every animated object in the scene.

AnimationObject() = default;
AnimationObject(const std::string& sheet_name,
const std::string& animation_strip_name,
RenderResources* render_resources,
const Colour& color = Colour::white,
float rotation = 0.0f,
SpriteFlip flip = SpriteFlip::none,
float layer_depth = 0.0f);

update · reset · stop · play · pause · set_frame_time · set_frame_time_to_default · is_paused (protected)

Section titled “update · reset · stop · play · pause · set_frame_time · set_frame_time_to_default · is_paused (protected)”
virtual void update(float dt);
void reset();
void stop();
void play();
void pause();
void set_frame_time(float frame_time);
void set_frame_time_to_default();
bool is_paused() const;
void set_frame_index(int frame_index);
void set_animation_strip_and_reset(const std::string& sprite_sheet,
const std::string& animation_strip);

Moves sheet and strip together - a strip handle resolved against one sheet indexes nothing meaningful in another.

virtual void draw(DrawList& draw_list,
const mattmath::RectangleF& destination_rectangle) const;
virtual void draw(DrawList& draw_list,
const mattmath::Vector2F& position, float scale = 1.0f) const;

No camera parameter; see TextureObject.

void draw_with(DrawList& draw_list,
const mattmath::RectangleF& destination_rectangle,
const Colour& colour,
SpriteFlip flip) const;

See TextureObject::draw_with - lets a caller vary colour and flip per draw without assigning them to this shared object first.

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