Named 2D frame sequence referencing SpriteSheet frame indices. Script type: SpriteClip.
更多...
#include <SpriteClip.h>
Public 成员函数 | |
| SpriteClip (const std::string &name="") | |
| ~SpriteClip ()=default | |
| SpriteClip (const SpriteClip &)=delete | |
| SpriteClip & | operator= (const SpriteClip &)=delete |
| void | setName (const std::string &name) |
| std::string | getName () const |
| void | setLoop (bool loop) |
| bool | getLoop () const |
| 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 | clear () |
| int | getFrameCount () const |
| int | getSheetFrame (int index) const |
| float | getFrameDuration (int index) const |
| float | getDuration () const |
| 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 第 14 行定义.
构造及析构函数说明
◆ SpriteClip() [1/2]
|
explicit |
在文件 SpriteClip.cpp 第 10 行定义.
◆ ~SpriteClip()
|
default |
◆ SpriteClip() [2/2]
|
delete |
成员函数说明
◆ addFrame()
| void eve::animation::SpriteClip::addFrame | ( | int | sheetFrameIndex, |
| float | duration = 0.1f |
||
| ) |
Append one cell: sheetFrameIndex + display duration (seconds).
在文件 SpriteClip.cpp 第 20 行定义.
被这些函数引用 addFrameByName().
◆ 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(), eve::animation::SpriteSheet::findFrame() , 以及 idx.
◆ clear()
| void eve::animation::SpriteClip::clear | ( | ) |
在文件 SpriteClip.cpp 第 36 行定义.
◆ 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 第 66 行定义.
引用了 getDuration(), getFrameCount() , 以及 wrapTime().
◆ getDuration()
| float eve::animation::SpriteClip::getDuration | ( | ) | const |
在文件 SpriteClip.cpp 第 48 行定义.
被这些函数引用 frameAtTime(), eve::animation::SpriteAnim::update() , 以及 wrapTime().
◆ getFrameCount()
|
inline |
在文件 SpriteClip.h 第 36 行定义.
被这些函数引用 frameAtTime().
◆ getFrameDuration()
| float eve::animation::SpriteClip::getFrameDuration | ( | int | index | ) | const |
在文件 SpriteClip.cpp 第 43 行定义.
◆ getLoop()
|
inline |
在文件 SpriteClip.h 第 26 行定义.
◆ getName()
|
inline |
在文件 SpriteClip.h 第 23 行定义.
◆ getSheetFrame()
| int eve::animation::SpriteClip::getSheetFrame | ( | int | index | ) | const |
在文件 SpriteClip.cpp 第 38 行定义.
◆ operator=()
|
delete |
◆ setLoop()
|
inline |
在文件 SpriteClip.h 第 25 行定义.
◆ setName()
| void eve::animation::SpriteClip::setName | ( | const std::string & | name | ) |
在文件 SpriteClip.cpp 第 12 行定义.
引用了 name.
◆ wrapTime()
| float eve::animation::SpriteClip::wrapTime | ( | float | timeSeconds | ) | const |
Local time wrapped or clamped according to loop flag.
在文件 SpriteClip.cpp 第 54 行定义.
引用了 getDuration().
被这些函数引用 frameAtTime().
该类的文档由以下文件生成:
- src/modules/animation/SpriteClip.h
- src/modules/animation/SpriteClip.cpp