SpriteAnimation¶
Inherits: Action
C++ type: SpriteAnimation
Description¶
Cycles through a sequence of texture atlas frames on its target Sprite, creating flip-book-style 2D animation. This is distinct from skeletal animation (Animation); SpriteAnimation only advances the active frame of a sprite sheet.
Properties¶
| Type | Name | Default | Langs |
|---|---|---|---|
| std::string | name | "" |
C++ | Lua |
Methods¶
| Type | Name | Langs |
|---|---|---|
| void | setAnimation | C++ | Lua |
Property details¶
name¶
Inherited from: EntityHandle
- Setter: void setName(const std::string& name)
- Getter: std::string getName() const
The sprite animation entity's human-readable name. The editor shows this name in the
Structure panel. There is no separate name stored in
SpriteAnimationComponent — rename the entity (or call
setName) when you need a label for lookup with
Scene::findEntity.
Method details¶
setAnimation¶
- void setAnimation(std::vector\<int> frames, std::vector\<int> framesTime, bool loop)
- void setAnimation(int startFrame, int endFrame, int interval, bool loop)
Configure the frame sequence.
First overload — explicit frame list with per-frame durations in milliseconds:
Second overload — range-based with a fixed interval (milliseconds per frame):