Struct Animation

Inheritance Relationships

Base Types

Struct Documentation

struct Animation : public CE::Assets::Content2D, public CE::Assets::Animation::Cursor<Animation>

Declaration: final

Owns a clip copy and retains its resources.

CE::Assets::Animation::Cursor’s index selects a clip entry, not a grid cell; looping wraps and nonlooping clamps. An empty clip throws. The caller schedules index changes from millisecond durations on one owner.

Public Functions

explicit Animation(Clip definition, const CE::Memory::Shared<CE::Rendering::Geometry::Buffer2D> &geometry, const CE::Memory::Shared<CE::Rendering::Resources::Image> &texture, std::shared_ptr<const CE::Rendering::Resources::Material> material = {})

Own a clip copy and retain its uploaded resources.

See also

Detailed guide

Parameters:
  • definition – Nonempty ordered timeline; loop selects inherited Wrap or Clamp policy.

  • geometry – Retained atlas geometry.

  • texture – Retained atlas image.

  • material – Optional retained material, with no default construction. An empty timeline rejects via Cursor; direct construction does not validate durations, cells or backend compatibility. Caller advances the ordinal from frame_duration() on one owner.

inline const Clip &definition() const

Declaration: [[nodiscard]]

Borrow the owned clip copy for this animation handle’s lifetime.

See also

Detailed guide

std::chrono::milliseconds frame_duration() const

Declaration: [[nodiscard]]

Read the selected clip-entry duration in milliseconds; does not advance time or validate positivity.

See also

Detailed guide

inline bool loops() const

Declaration: [[nodiscard]]

Read the clip’s loop flag used to select inherited ordinal policy.

See also

Detailed guide