Ovis_Decoration_2D_Triangle_Create()
摘要
创建 2D 三角形。
语法
Ovis_Decoration_2D_Triangle_Create (center, a, b, c, color, filled, layer_ptr, destroy_proc, user_state_ptr)
| 参数 | 类型 | 说明 |
|---|---|---|
center |
OvisT_2D_Position |
三角形的中心 |
a |
OvisT_2D_Corner |
三角形的 a 角 |
b |
OvisT_2D_Corner |
三角形的 b 角 |
c |
OvisT_2D_Corner |
三角形的 c 角 |
color |
PrgT_Color |
颜色 |
filled |
OvisT_Boolean |
指示是否填充 |
layer_ptr |
OvisT_Layer * |
Ovis 图层 |
destroy_proc |
OvisT_Decoration_State_Destroy_Proc |
销毁与该对象关联的数据并释放其内存 |
user_state_ptr |
void * |
可选的用户提供的装饰状态 |
返回类型
OvisT_2D_Triangle *
该 2D 三角形
头文件
ovis_decoration.h
详情
该函数创建 Ovis 2D 三角形,并指定三角形的各属性。
示例
OvisT_2D_Position center;
OvisT_2D_Corner a, b, c;
OvisT_2D_Triangle * triangle;
/* A right angle triangle at the center */
center.x = 10; center.y = 50;
a.x_offset = a.y_offset = 0;
b.x_offset = 0; b.y_offset = -0.2;
c.x_offset = 0.2; c.y_offset = 0;
triangle = Ovis_Decoration_2D_Triangle_Create (center, a, b, c,
prg_color_from_string ("red"), OvisC_True, OPC_NIL, OPC_NIL, OPC_NIL);
错误
- 中心 2D 位置 <x,y> 无效。2D 位置值必须在 -128 到 127 之间。
参考
- 使用
Ovis_2D_Triangle_Corners_Set()函数修改三角形的各角。 - 使用
Ovis_2D_Polygon_Center_Set()函数移动三角形。 - 使用
Ovis_2D_Polygon_Rotation_Set()函数绕中心旋转三角形。 - 使用
Ovis_2D_Polygon_Scale_Set()函数改变三角形的大小。 - 使用
Ovis_Decoration_Color_Set()函数修改三角形的颜色。 - 使用
Ovis_Decoration_Transparency_Set()函数修改三角形的透明度。 - 使用
Ovis_Decoration_Flashing_Set()函数修改闪烁状态。 - 使用
Ovis_Shape_Pattern_Set()函数修改三角形所使用的图案。