Sprite-sheet / texture-atlas frame table (pixel rects). 更多...
#include <SpriteSheet.h>
Public 成员函数 | |
| SpriteSheet ()=default | |
| ~SpriteSheet ()=default | |
| SpriteSheet (const SpriteSheet &)=delete | |
| SpriteSheet & | operator= (const SpriteSheet &)=delete |
| int | addFrame (const std::string &name, int x, int y, int w, int h) |
| Append a named frame. Returns frame index. Empty name → "frameN". | |
| int | setGrid (int columns, int rows, int frameW, int frameH, int margin=0, int spacing=0, int originX=0, int originY=0) |
| Generate frames in row-major order from a grid. frameW/frameH are cell sizes; margin is outer padding; spacing is gap between cells. Returns number of frames added. | |
| void | clear () |
| int | getFrameCount () const |
| int | findFrame (const std::string &name) const |
| std::string | getFrameName (int index) const |
| int | getFrameX (int index) const |
| int | getFrameY (int index) const |
| int | getFrameWidth (int index) const |
| int | getFrameHeight (int index) const |
| void | applyToQuad (graphics::Quad *quad, int frameIndex) const |
| Write pixel viewport into an existing Quad (does not allocate). | |
详细描述
Sprite-sheet / texture-atlas frame table (pixel rects).
Frames may be added by name or generated from a uniform grid. Does not own a Texture — pair with Graphics textures in script. Script type: SpriteSheet.
在文件 SpriteSheet.h 第 20 行定义.
构造及析构函数说明
◆ SpriteSheet() [1/2]
|
default |
◆ ~SpriteSheet()
|
default |
◆ SpriteSheet() [2/2]
|
delete |
成员函数说明
◆ addFrame()
| int eve::animation::SpriteSheet::addFrame | ( | const std::string & | name, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h | ||
| ) |
◆ applyToQuad()
| void eve::animation::SpriteSheet::applyToQuad | ( | graphics::Quad * | quad, |
| int | frameIndex | ||
| ) | const |
Write pixel viewport into an existing Quad (does not allocate).
在文件 SpriteSheet.cpp 第 87 行定义.
引用了 f , 以及 eve::graphics::Quad::setViewport().
◆ clear()
| void eve::animation::SpriteSheet::clear | ( | ) |
在文件 SpriteSheet.cpp 第 52 行定义.
被这些函数引用 setGrid().
◆ findFrame()
| int eve::animation::SpriteSheet::findFrame | ( | const std::string & | name | ) | const |
◆ getFrameCount()
|
inline |
在文件 SpriteSheet.h 第 41 行定义.
◆ getFrameHeight()
| int eve::animation::SpriteSheet::getFrameHeight | ( | int | index | ) | const |
在文件 SpriteSheet.cpp 第 82 行定义.
引用了 h.
◆ getFrameName()
| std::string eve::animation::SpriteSheet::getFrameName | ( | int | index | ) | const |
在文件 SpriteSheet.cpp 第 62 行定义.
引用了 name.
◆ getFrameWidth()
| int eve::animation::SpriteSheet::getFrameWidth | ( | int | index | ) | const |
在文件 SpriteSheet.cpp 第 77 行定义.
引用了 w.
◆ getFrameX()
| int eve::animation::SpriteSheet::getFrameX | ( | int | index | ) | const |
在文件 SpriteSheet.cpp 第 67 行定义.
引用了 x.
◆ getFrameY()
| int eve::animation::SpriteSheet::getFrameY | ( | int | index | ) | const |
在文件 SpriteSheet.cpp 第 72 行定义.
引用了 y.
◆ operator=()
|
delete |
◆ setGrid()
| int eve::animation::SpriteSheet::setGrid | ( | int | columns, |
| int | rows, | ||
| int | frameW, | ||
| int | frameH, | ||
| int | margin = 0, |
||
| int | spacing = 0, |
||
| int | originX = 0, |
||
| int | originY = 0 |
||
| ) |
Generate frames in row-major order from a grid. frameW/frameH are cell sizes; margin is outer padding; spacing is gap between cells. Returns number of frames added.
在文件 SpriteSheet.cpp 第 30 行定义.
引用了 addFrame(), clear(), columns, margin, spacing, x , 以及 y.
该类的文档由以下文件生成:
- src/modules/animation/SpriteSheet.h
- src/modules/animation/SpriteSheet.cpp