6#include <unordered_map>
28 void setName(
const std::string &
name);
30 std::string
getName()
const {
return name_; }
38 void addFrame(
int sheetFrameIndex,
float duration = 0.1f);
41 void addFrameByName(
SpriteSheet *sheet,
const std::string &frameName,
float duration = 0.1f);
44 void addRange(
int firstSheetFrame,
int lastSheetFrame,
float fps);
46 void setFPS(
float fps);
50 void addEvent(
int clipFrame,
const std::string &
name);
52 std::string getEvent(
int clipFrame)
const;
60 int getSheetFrame(
int index)
const;
62 float getFrameDuration(
int index)
const;
64 float getDuration()
const;
70 int frameAtTime(
float timeSeconds)
const;
73 float wrapTime(
float timeSeconds)
const;
81 void checkIndex(
int index)
const;
85 std::vector<Entry> frames_;
86 std::unordered_map<int, std::string> events_;
#define EVENGINE_API_WORLD
Named 2D frame sequence referencing SpriteSheet frame indices. Script type: SpriteClip.
SpriteClip(const SpriteClip &)=delete
~SpriteClip()=default
Sprite clip.
std::string getName() const
Returns the name.
void setLoop(bool loop)
Sets the loop.
int getFrameCount() const
Returns the frame count.
bool getLoop() const
Returns the loop.
SpriteClip & operator=(const SpriteClip &)=delete
Sprite-sheet / texture-atlas frame table (pixel rects).