![]() |
CMGDK r49-rc2
|
HGP图片管理类 更多...
#include <HGP.H>
公有成员 | |
HGP () | |
本类构造函数 | |
HGP (TDFNode *, uint=0, uint=1) | |
本类构造函数 | |
HGP (Stream *, uint=0, uint=1) | |
本类构造函数 | |
HGP (const wchar_t *, uint=0, uint=1) | |
本类构造函数 | |
HGP (HAC *, const wchar_t *, uint=0, uint=1) | |
本类构造函数 | |
virtual | ~HGP () |
本类析构函数 | |
virtual bool | Load (TDFNode *, uint=0, uint=1) |
从TDF中加载HGP | |
bool | Load (Stream *, uint=0, uint=1) |
从流中加载HGP | |
bool | Load (const wchar_t *, uint=0, uint=1) |
加载一个HGP文件 | |
bool | Load (HAC *, const wchar_t *, uint=0, uint=1) |
加载一个HGP文件 | |
virtual void | Clear () |
清除HGP文件 | |
void | Draw (double, double, double=1, double=1) |
绘制图片(指定宽高缩放系数) | |
bool | Draw (const Vertex2f *) |
绘制图片(指定四个顶点) | |
void | DrawRect (double l, double t, double w, double h) |
void | Draw (const RectScope2f &rs) |
绘制图片(指定范围) | |
void | DrawLayer (int, double, double, double=1, double=1) |
绘制某一层(指定宽高缩放系数) | |
bool | DrawLayer (int, const Vertex2f *) |
绘制某一层(指定四个顶点) | |
void | DrawLayerRect (int n, double l, double t, double w, double h) |
void | DrawLayer (int n, const RectScope2f &rs) |
void | DrawTile (float, float, float, float, int=1, int=1) |
连续拼接绘制 | |
HGPLayer * | CreateLayer (const wchar_t *) |
创建一个新层 | |
HGPLayer * | GetLayer (int) |
取图片指定层 | |
HGPLayer * | GetLayer (const wchar_t *) |
按名称查找层 | |
void | SetShow (bool) |
设置所有层显示属性 | |
void | SetBlend (BlendMode &) |
设置所有层的混合模式 | |
void | SetAlpha (float) |
设置所有层的Alpha值 | |
void | SetColor3f (float, float, float) |
设置所有层的颜色 | |
void | SetColor4f (float, float, float, float) |
设置所有层的颜色以及Alpha | |
void | SetColor4fv (float *v) |
设置所有层的颜色 | |
void | SetColor (const Color4f &v) |
设置所有层的颜色 | |
void | SetColor4b (int r, int g, int b, int a) |
设置所有层的颜色 | |
公有属性 | |
Property< int > | Width |
图形宽度(只读) | |
Property< int > | Height |
图形高度(只读) | |
Property< int > | LayerNumber |
图片层数(只读) | |
Property< TextureFilter > | Filter |
贴图过滤方式(只写) | |
Property< int > | Anisotropy |
图片各向异性过滤级别(只写) |
HGP图片管理类
HGP图片管理类,它用于一般状态下2D图片的显示。不管显卡是否支持非2次幂贴图,它都能正常显示图片。但处理方式会有所不同。
hgl::HGP::HGP | ( | ) |
本类构造函数
hgl::HGP::~HGP | ( | ) | [virtual] |
本类析构函数
void hgl::HGP::Clear | ( | ) | [virtual] |
清除HGP文件
清除数据
HGPLayer * hgl::HGP::CreateLayer | ( | const wchar_t * | name | ) |
创建一个新层
创建一个新层
name | 层的名字 |
void hgl::HGP::Draw | ( | const RectScope2f & | rs | ) | [inline] |
绘制图片(指定范围)
void hgl::HGP::Draw | ( | double | left, |
double | top, | ||
double | scale_width = 1 , |
||
double | scale_height = 1 |
||
) |
绘制图片(指定宽高缩放系数)
使用当前图片绘制一个矩形
left | 矩形左边坐标 top 矩形上边坐标 |
scale_width | 宽度缩放系数,不变即为1 |
scale_height | 高度缩放系数,不变即为1 |
bool hgl::HGP::Draw | ( | const Vertex2f * | coord | ) |
绘制图片(指定四个顶点)
按指定四角顶点坐标绘制图片
coord | 指定的四个顶点坐标,依次为左上、右上、右下、左下 |
void hgl::HGP::DrawLayer | ( | int | layer_index, |
double | left, | ||
double | top, | ||
double | scale_width = 1 , |
||
double | scale_height = 1 |
||
) |
绘制某一层(指定宽高缩放系数)
使用当前图片的某一层绘制一个矩形
layer_index | 层次索引 |
left | 矩形左边坐标 top 矩形上边坐标 |
scale_width | 宽度缩放系数,不变即为1 |
scale_height | 高度缩放系数,不变即为1 |
绘制某一层(指定四个顶点)
按指定四角顶点坐标绘制图片的某一层
layer_index | 层次索引 |
coord | 指定的四个顶点坐标,依次为左上、右上、右下、左下 |
void hgl::HGP::DrawLayer | ( | int | n, |
const RectScope2f & | rs | ||
) | [inline] |
rs | 绘制某一层(指定范围) |
void hgl::HGP::DrawLayerRect | ( | int | n, |
double | l, | ||
double | t, | ||
double | w, | ||
double | h | ||
) | [inline] |
h | 绘制某一层(指定范围) |
void hgl::HGP::DrawRect | ( | double | l, |
double | t, | ||
double | w, | ||
double | h | ||
) | [inline] |
h | 绘制图片(指定范围) |
void hgl::HGP::DrawTile | ( | float | left, |
float | top, | ||
float | width, | ||
float | height, | ||
int | col_count = 1 , |
||
int | row_count = 1 |
||
) |
连续拼接绘制
利用当前图片连接拼接绘制出一个矩形
left | 矩形坐边坐标 top 矩形上边坐标 |
width | 宽度 |
height | 高度 |
col_count | 列向画多少个 |
row_count | 横向画多少个 |
HGPLayer * hgl::HGP::GetLayer | ( | const wchar_t * | name | ) |
按名称查找层
按名称查称相应层
name | 层的名称 |
加载一个HGP文件
加载一个HGP文件,(注:仅工具专用版SDK支持PSD)
hac | 文件所在HAC包 |
fn | HGP文件名称 |
format | 强制指定的图像保存格式(在显存中使用的OpenGL格式) |
从TDF中加载HGP
从TDF节点中加载HGP数据
format | 强制指定的图像保存格式(在显存中使用的OpenGL格式) |
tdf | TDF节点 |
return | 是否加载数据成功 |
被hgl::HGPSame重载。
从流中加载HGP
从TDF节点中加载HGP数据
format | 强制指定的图像保存格式(在显存中使用的OpenGL格式) |
stream | 数据流 |
加载一个HGP文件
加载一个HGP文件,(注:仅工具专用版SDK支持PSD)
fn | HGP文件名称 |
format | 强制指定的图像保存格式(在显存中使用的OpenGL格式) |
void hgl::HGP::SetAlpha | ( | float | alpha | ) |
设置所有层的Alpha值
void hgl::HGP::SetBlend | ( | BlendMode & | bm | ) |
设置所有层的混合模式
设置所有层的混合方式
bm | 混合方式 |
void hgl::HGP::SetColor | ( | const Color4f & | v | ) | [inline] |
设置所有层的颜色
void hgl::HGP::SetColor3f | ( | float | r, |
float | g, | ||
float | b | ||
) |
设置所有层的颜色
设置所有层的颜色系数
r | 红色系数(0.0-1.0) |
g | 红色系数(0.0-1.0) |
b | 红色系数(0.0-1.0) |
void hgl::HGP::SetColor4f | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
设置所有层的颜色以及Alpha
设置所有层的颜色系数
r | 红色系数(0.0-1.0) |
g | 红色系数(0.0-1.0) |
b | 红色系数(0.0-1.0) |
a | 透明度系数(0.0-1.0) |
void hgl::HGP::SetColor4fv | ( | float * | v | ) | [inline] |
设置所有层的颜色
void hgl::HGP::SetShow | ( | bool | flag | ) |
设置所有层显示属性
设置所有层的显示属性
flag | 是否显示 |
图片各向异性过滤级别(只写)
贴图过滤方式(只写)
图形高度(只读)
图片层数(只读)
图形宽度(只读)