Named 2D frame sequence referencing SpriteSheet frame indices. Script type: SpriteClip.
更多...
#include <SpriteClip.h>
Public 成员函数 | |
| SpriteClip (const std::string &name="") | |
| Sprite clip. | |
| ~SpriteClip ()=default | |
| Sprite clip. | |
| SpriteClip (const SpriteClip &)=delete | |
| SpriteClip & | operator= (const SpriteClip &)=delete |
| void | setName (const std::string &name) |
| Sets the name. | |
| std::string | getName () const |
| Returns the name. | |
| void | setLoop (bool loop) |
| Sets the loop. | |
| bool | getLoop () const |
| Returns the loop. | |
| void | addFrame (int sheetFrameIndex, float duration=0.1f) |
| Append one cell: sheetFrameIndex + display duration (seconds). | |
| void | addFrameByName (SpriteSheet *sheet, const std::string &frameName, float duration=0.1f) |
| Resolve name via sheet and append. | |
| void | addRange (int firstSheetFrame, int lastSheetFrame, float fps) |
| Append inclusive sheet-frame range at a uniform frame rate. | |
| void | setFPS (float fps) |
| Replace every existing frame duration with 1/fps. | |
| float | getFPS () const |
| Uniform FPS, or 0 when empty/variable-duration. | |
| void | addEvent (int clipFrame, const std::string &name) |
| Attach a named event to a clip-frame index. | |
| std::string | getEvent (int clipFrame) const |
| Return event name for a frame, or empty when none. | |
| void | clear () |
| Clears . | |
| int | getFrameCount () const |
| Returns the frame count. | |
| int | getSheetFrame (int index) const |
| Returns the sheet frame. | |
| float | getFrameDuration (int index) const |
| Returns the frame duration. | |
| float | getDuration () const |
| Returns the duration. | |
| int | frameAtTime (float timeSeconds) const |
| Map absolute time (seconds) into a clip frame index. When loop is false and t >= duration, returns last frame. | |
| float | wrapTime (float timeSeconds) const |
| Local time wrapped or clamped according to loop flag. | |
详细描述
Named 2D frame sequence referencing SpriteSheet frame indices. Script type: SpriteClip.
在文件 SpriteClip.h 第 17 行定义.
构造及析构函数说明
◆ SpriteClip() [1/2]
|
explicit |
Sprite clip.
在文件 SpriteClip.cpp 第 10 行定义.
◆ ~SpriteClip()
|
default |
Sprite clip.
◆ SpriteClip() [2/2]
|
delete |
成员函数说明
◆ addEvent()
| void eve::animation::SpriteClip::addEvent | ( | int | clipFrame, |
| const std::string & | name | ||
| ) |
◆ addFrame()
| void eve::animation::SpriteClip::addFrame | ( | int | sheetFrameIndex, |
| float | duration = 0.1f |
||
| ) |
Append one cell: sheetFrameIndex + display duration (seconds).
在文件 SpriteClip.cpp 第 20 行定义.
引用了 duration.
被这些函数引用 addFrameByName() , 以及 addRange().
◆ addFrameByName()
| void eve::animation::SpriteClip::addFrameByName | ( | SpriteSheet * | sheet, |
| const std::string & | frameName, | ||
| float | duration = 0.1f |
||
| ) |
Resolve name via sheet and append.
在文件 SpriteClip.cpp 第 27 行定义.
引用了 addFrame(), duration, eve::animation::SpriteSheet::findFrame() , 以及 idx.
◆ addRange()
| void eve::animation::SpriteClip::addRange | ( | int | firstSheetFrame, |
| int | lastSheetFrame, | ||
| float | fps | ||
| ) |
Append inclusive sheet-frame range at a uniform frame rate.
在文件 SpriteClip.cpp 第 36 行定义.
引用了 addFrame() , 以及 duration.
◆ clear()
| void eve::animation::SpriteClip::clear | ( | ) |
Clears .
在文件 SpriteClip.cpp 第 71 行定义.
◆ frameAtTime()
| int eve::animation::SpriteClip::frameAtTime | ( | float | timeSeconds | ) | const |
Map absolute time (seconds) into a clip frame index. When loop is false and t >= duration, returns last frame.
在文件 SpriteClip.cpp 第 101 行定义.
引用了 duration, getDuration(), getFrameCount(), t , 以及 wrapTime().
◆ getDuration()
| float eve::animation::SpriteClip::getDuration | ( | ) | const |
Returns the duration.
在文件 SpriteClip.cpp 第 83 行定义.
被这些函数引用 frameAtTime(), eve::animation::SpriteAnim::playReverse() , 以及 wrapTime().
◆ getEvent()
| std::string eve::animation::SpriteClip::getEvent | ( | int | clipFrame | ) | const |
Return event name for a frame, or empty when none.
在文件 SpriteClip.cpp 第 66 行定义.
◆ getFPS()
| float eve::animation::SpriteClip::getFPS | ( | ) | const |
◆ getFrameCount()
|
inline |
Returns the frame count.
在文件 SpriteClip.h 第 58 行定义.
被这些函数引用 frameAtTime(), eve::animation::SpriteAnim::setFrame() , 以及 eve::animation::SpriteAnim::step().
◆ getFrameDuration()
| float eve::animation::SpriteClip::getFrameDuration | ( | int | index | ) | const |
Returns the frame duration.
在文件 SpriteClip.cpp 第 78 行定义.
◆ getLoop()
|
inline |
◆ getName()
|
inline |
Returns the name.
在文件 SpriteClip.h 第 30 行定义.
◆ getSheetFrame()
| int eve::animation::SpriteClip::getSheetFrame | ( | int | index | ) | const |
◆ operator=()
|
delete |
◆ setFPS()
| void eve::animation::SpriteClip::setFPS | ( | float | fps | ) |
◆ setLoop()
|
inline |
◆ setName()
| void eve::animation::SpriteClip::setName | ( | const std::string & | name | ) |
◆ wrapTime()
| float eve::animation::SpriteClip::wrapTime | ( | float | timeSeconds | ) | const |
Local time wrapped or clamped according to loop flag.
在文件 SpriteClip.cpp 第 89 行定义.
引用了 getDuration() , 以及 t.
被这些函数引用 frameAtTime().
该类的文档由以下文件生成:
- src/modules/animation/SpriteClip.h
- src/modules/animation/SpriteClip.cpp