Ovis_Decoration_2D_Text_Create()
摘要
创建 2D 文本。
语法
Ovis_Decoration_2D_Text_Create (text, position, color, layer_ptr, destroy_proc, user_state_ptr)
| 参数 | 类型 | 说明 |
|---|---|---|
text |
const char * |
文本 |
position |
OvisT_2D_Position |
文本的位置 |
color |
PrgT_Color |
颜色 |
layer_ptr |
OvisT_Layer * |
Ovis 图层 |
destroy_proc |
OvisT_Decoration_State_Destroy_Proc |
销毁与该对象关联的数据并释放其内存 |
user_state_ptr |
void * |
可选的用户提供的装饰状态 |
返回类型
OvisT_2D_Text *
该 2D 文本
头文件
ovis_decoration.h
详情
该函数创建 Ovis 2D 文本,并指定文本的各属性。文本初始透明度为 0%(完全可见),且不闪烁。
示例
OvisT_2D_Position pos;
OvisT_2D_Text * text;
PrgT_Color color = prg_rgb_from_string ("blue");
pos.x = 20;
pos.y = 0; /* middle of the window */
text = Ovis_Decoration_2D_Text_Create ("This is my text", pos, color,
OPC_NIL, OPC_NIL, OPC_NIL);
错误
- 2D 位置 <x,y> 无效。2D 位置值必须在 -128 到 127 之间。
参考
- 使用
Ovis_2D_Text_Position_Set()函数修改文本的位置。 - 使用
Ovis_Text_String_Set()函数修改所显示的文本。 - 使用
Ovis_Decoration_Color_Set()函数修改文本的颜色。 - 使用
Ovis_Decoration_Transparency_Set()函数修改文本的透明度。 - 使用
Ovis_Decoration_Flashing_Set()函数修改闪烁状态。