CMGDK r49-rc2
公有成员 | 公有属性
hgl::HGP类参考

HGP图片管理类 更多...

#include <HGP.H>

继承图,类hgl::HGP
hgl::DataObject hgl::Object hgl::_Object hgl::HGPSame

所有成员的列表。

公有成员

 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)
 连续拼接绘制
HGPLayerCreateLayer (const wchar_t *)
 创建一个新层
HGPLayerGetLayer (int)
 取图片指定层
HGPLayerGetLayer (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< intWidth
 图形宽度(只读)
Property< intHeight
 图形高度(只读)
Property< intLayerNumber
 图片层数(只读)
Property< TextureFilterFilter
 贴图过滤方式(只写)
Property< intAnisotropy
 图片各向异性过滤级别(只写)

详细描述

HGP图片管理类

HGP图片管理类,它用于一般状态下2D图片的显示。不管显卡是否支持非2次幂贴图,它都能正常显示图片。但处理方式会有所不同。


构造及析构函数文档

hgl::HGP::HGP ( )

本类构造函数

hgl::HGP::HGP ( TDFNode tdf,
uint  format = 0,
uint  mip = 1 
)

本类构造函数

hgl::HGP::HGP ( Stream str,
uint  format = 0,
uint  mip = 1 
)

本类构造函数

hgl::HGP::HGP ( const wchar_t *  fn,
uint  format = 0,
uint  mip = 1 
)

本类构造函数

hgl::HGP::HGP ( HAC hac,
const wchar_t *  fn,
uint  format = 0,
uint  mip = 1 
)

本类构造函数

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
bool hgl::HGP::DrawLayer ( int  layer_index,
const Vertex2f coord 
)

绘制某一层(指定四个顶点)

按指定四角顶点坐标绘制图片的某一层

参数:
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 ( int  index)

取图片指定层

取图片指定层

参数:
index层索引
返回:
指定层,返回NULL表示失败
HGPLayer * hgl::HGP::GetLayer ( const wchar_t *  name)

按名称查找层

按名称查称相应层

参数:
name层的名称
返回:
相应的层,如果没找到返回NULL
bool hgl::HGP::Load ( HAC hac,
const wchar_t *  fn,
uint  format = 0,
uint  mip = 1 
)

加载一个HGP文件

加载一个HGP文件,(注:仅工具专用版SDK支持PSD)

参数:
hac文件所在HAC包
fnHGP文件名称
format强制指定的图像保存格式(在显存中使用的OpenGL格式)
返回:
是否加载成功
bool hgl::HGP::Load ( TDFNode tdf,
uint  format = 0,
uint  mip = 1 
) [virtual]

从TDF中加载HGP

从TDF节点中加载HGP数据

参数:
format强制指定的图像保存格式(在显存中使用的OpenGL格式)
tdfTDF节点
return是否加载数据成功

hgl::HGPSame重载。

bool hgl::HGP::Load ( Stream stream,
uint  format = 0,
uint  mip = 1 
)

从流中加载HGP

从TDF节点中加载HGP数据

参数:
format强制指定的图像保存格式(在显存中使用的OpenGL格式)
stream数据流
返回:
是否加载成功
bool hgl::HGP::Load ( const wchar_t *  fn,
uint  format = 0,
uint  mip = 1 
)

加载一个HGP文件

加载一个HGP文件,(注:仅工具专用版SDK支持PSD)

参数:
fnHGP文件名称
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::SetColor4b ( int  r,
int  g,
int  b,
int  a 
) [inline]

设置所有层的颜色

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是否显示

成员数据文档

图片各向异性过滤级别(只写)

贴图过滤方式(只写)

图形高度(只读)

图片层数(只读)

图形宽度(只读)


该类的文档由以下文件生成:
 全部  名字空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义