Ovis_Decoration_2D_Triangle_Create()
Abstract
Creates a 2D triangle.
Syntax
Ovis_Decoration_2D_Triangle_Create (center, a, b, c, color, filled, layer_ptr, destroy_proc, user_state_ptr)
| Argument | Type | Description |
|---|---|---|
center |
OvisT_2D_Position |
Center of the triangle |
a |
OvisT_2D_Corner |
Corner a of the triangle |
b |
OvisT_2D_Corner |
Corner b of the triangle |
c |
OvisT_2D_Corner |
Corner c of the triangle |
color |
PrgT_Color |
Color |
filled |
OvisT_Boolean |
Indicates fill |
layer_ptr |
OvisT_Layer * |
Ovis layer |
destroy_proc |
OvisT_Decoration_State_Destroy_Proc |
Destroys the data associated with the object and deallocates its memory |
user_state_ptr |
void * |
Optional user-provided state of the decoration |
Return Type
OvisT_2D_Triangle *
The 2D triangle
Header
ovis_decoration.h
Details
This function creates an Ovis 2D triangle. It specifies the attributes of the triangle.
Example
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);
Errors
- Invalid center 2D position <x,y>. 2D position values must be between -128 and 127.
Reference
- Use the function
Ovis_2D_Triangle_Corners_Set()to modify the corners of the triangle. - Use the function
Ovis_2D_Polygon_Center_Set()to move the triangle. - Use the function
Ovis_2D_Polygon_Rotation_Set()to rotate the triangle around its center. - User the function
Ovis_2D_Polygon_Scale_Set()to change the size of the triangle. - Use the function
Ovis_Decoration_Color_Set()to modify the color of the triangle. - Use the function
Ovis_Decoration_Transparency_Set()to modify the transparency of the triangle. - Use the function
Ovis_Decoration_Flashing_Set()to modify the flashing status. - Use the function
Ovis_Shape_Pattern_Set()to modify the pattern used in the triangle.