载入中...
搜索中...
未找到
SpriteSheet.cpp
浏览该文件的文档.
39int SpriteSheet::getFrameSourceWidth(int i) const { checkIndex(i); return frames_[size_t(i)].sourceW; }
40int SpriteSheet::getFrameSourceHeight(int i) const { checkIndex(i); return frames_[size_t(i)].sourceH; }
41int SpriteSheet::getFrameOffsetX(int i) const { checkIndex(i); return frames_[size_t(i)].offsetX; }
42int SpriteSheet::getFrameOffsetY(int i) const { checkIndex(i); return frames_[size_t(i)].offsetY; }
Sprite-sheet / texture-atlas frame table (pixel rects).
Definition SpriteSheet.h:23
int addFrame(const std::string &name, int x, int y, int w, int h)
Append a named frame. Returns frame index. Empty name → "frameN".
Definition SpriteSheet.cpp:14
int getFrameSourceWidth(int index) const
Returns the frame source width.
Definition SpriteSheet.cpp:39
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...
Definition SpriteSheet.cpp:44
SpriteSheet * clone() const
Duplicate frame metadata while sharing the borrowed atlas texture.
Definition SpriteSheet.cpp:108
void applyToQuad(graphics::Quad *quad, int frameIndex) const
Write pixel viewport into an existing Quad (does not allocate).
Definition SpriteSheet.cpp:101
int getFrameSourceHeight(int index) const
Returns the frame source height.
Definition SpriteSheet.cpp:40
int addFrameTrimmed(const std::string &name, int x, int y, int w, int h, int sourceW, int sourceH, int offsetX, int offsetY)
Append a trimmed frame with original canvas size and content offset.
Definition SpriteSheet.cpp:18
Pixel-space sub-rectangle of a Texture (atlas cell / sprite frame). UV conversion uses the texture's ...
Definition Quad.h:11
Definition Animation.cpp:58
@ Exception