Kiwano Engine v1.3.x
|
精灵帧 更多...
#include <SpriteFrame.h>
Public 成员函数 | |
SpriteFrame (StringView file_path) | |
创建精灵帧 更多... | |
SpriteFrame (const Resource &res) | |
创建精灵帧 更多... | |
SpriteFrame (RefPtr< Texture > texture) | |
创建精灵帧 更多... | |
SpriteFrame (StringView file_path, const Rect &crop_rect) | |
创建精灵帧 更多... | |
SpriteFrame (const Resource &res, const Rect &crop_rect) | |
创建精灵帧 更多... | |
SpriteFrame (RefPtr< Texture > texture, const Rect &crop_rect) | |
创建精灵帧 更多... | |
bool | Load (StringView file_path) |
加载图像 更多... | |
bool | Load (const Resource &res) |
加载图像 更多... | |
bool | IsValid () const |
是否有效 | |
const Rect & | GetCropRect () const |
获取裁剪矩形 | |
RefPtr< Texture > | GetTexture () const |
获取纹理 | |
Size | GetSize () const |
获取精灵帧大小 | |
void | SetCropRect (const Rect &crop_rect) |
裁剪精灵帧为矩形 更多... | |
void | SetTexture (RefPtr< Texture > texture) |
设置纹理并重置裁剪矩形 更多... | |
Vector< SpriteFrame > | Split (int cols, int rows, int max_num=-1, float padding_x=0, float padding_y=0) |
按行列分割精灵帧 更多... | |
精灵帧
kiwano::SpriteFrame::SpriteFrame | ( | StringView | file_path | ) |
创建精灵帧
file_path | 图像路径 |
kiwano::SpriteFrame::SpriteFrame | ( | const Resource & | res | ) |
创建精灵帧
res | 图像资源 |
kiwano::SpriteFrame::SpriteFrame | ( | StringView | file_path, |
const Rect & | crop_rect | ||
) |
创建精灵帧
file_path | 图像路径 |
crop_rect | 裁剪矩形 |
创建精灵帧
res | 图像资源 |
crop_rect | 裁剪矩形 |
创建精灵帧
texture | 纹理 |
crop_rect | 裁剪矩形 |
bool kiwano::SpriteFrame::Load | ( | const Resource & | res | ) |
加载图像
res | 图像资源 |
bool kiwano::SpriteFrame::Load | ( | StringView | file_path | ) |
加载图像
file_path | 图像路径 |
void kiwano::SpriteFrame::SetCropRect | ( | const Rect & | crop_rect | ) |
裁剪精灵帧为矩形
crop_rect | 裁剪矩形 |
Vector< SpriteFrame > kiwano::SpriteFrame::Split | ( | int | cols, |
int | rows, | ||
int | max_num = -1 , |
||
float | padding_x = 0 , |
||
float | padding_y = 0 |
||
) |
按行列分割精灵帧
cols | 列数 |
rows | 行数 |
max_num | 最大帧数量,设-1为将分割后的图像全部作为序列帧 |
padding_x | X方向间隔 |
padding_y | Y方向间隔 |