Ovis_2D_Polygon_Center_Set()
摘要
指定 2D 多边形(圆形、方形或三角形)的中心。
语法
Ovis_2D_Polygon_Center_Set (poly_dec_ptr, center)
| 参数 | 类型 | 说明 |
|---|---|---|
poly_dec_ptr |
OvisT_2D_Polygon * |
多边形 |
center |
OvisT_2D_Position |
多边形的中心 |
返回类型
OvisT_Compcode
若提供的对象是有效的 2D 多边形,返回 OvisC_Compcode_Success;否则返回 OvisC_Compcode_Failure。
头文件
ovis_decoration.h
详情
该函数指定 2D 多边形中心的坐标。
注意: 在 11.5 版本之前,该功能以 Ovis_2D_Circle_Center_Set() 和 Ovis_2D_Square_Center_Set() 的形式提供。旧名称仍然可用,但它们只是对本函数的重命名。
示例
OvisT_2D_Position pos;
OvisT_2D_Triangle * triangle;
/* … triangle created at some point */
pos.x = pos.y = 0; /* middle of the screen */
Ovis_2D_Polygon_Center_Set (triangle, pos);
错误
- Decoration 为 NIL。
- Decoration 不是 2D 多边形。
- 无效的 2D 位置 <x,y>。2D 位置值必须在 –128 到 127 之间。
参考
- 使用函数
Ovis_2D_Polygon_Center_Get()获取多边形的中心。