Functions | |
| XY_lines * | XY_new_lines (void) |
| Create a new line collection. | |
| XY_lines * | XY_duplicate_lines (XY_lines *lines) |
| Duplicates a collection. | |
| XY_bool | XY_free_lines (XY_lines *lines) |
| Free a line collection. | |
| XY_bool | XY_start_lines (XY_lines *lines) |
| Reset a line collection so that it contains no lines. | |
| XY_bool | XY_add_line (XY_lines *lines, XY_fixed x1, XY_fixed y1, XY_fixed x2, XY_fixed y2, XY_color color, XY_fixed thickness) |
| Add a line to a line collection. | |
| XY_bool | XY_translate_lines (XY_lines *lines, XY_fixed x, XY_fixed y) |
| Translate all lines within a collection. | |
| XY_bool | XY_scale_lines (XY_lines *lines, XY_fixed xscale, XY_fixed yscale) |
| Scale all lines within a collection (centered around the origin (0,0)). | |
| XY_bool | XY_rotate_lines (XY_lines *lines, int angle) |
| Rotate all lines within a collection (centered around the origin (0,0)). | |
| XY_lines* XY_new_lines | ( | void | ) |
Reset a line collection so that it contains no lines.
This allows you to reconstruct a line collection (without making a new one) at different times (e.g., at the start of a new frame).
| lines | is an XY_lines pointer to reset. |
| XY_bool XY_add_line | ( | XY_lines * | lines, | |
| XY_fixed | x1, | |||
| XY_fixed | y1, | |||
| XY_fixed | x2, | |||
| XY_fixed | y2, | |||
| XY_color | color, | |||
| XY_fixed | thickness | |||
| ) |
Add a line to a line collection.
| lines | is an XY_lines pointer to add a line to. | |
| x1 | is the X coordinate of the new line's starting point. | |
| y1 | is the Y coordinate of the new line's starting point. | |
| x2 | is the X coordinate of the new line's ending point. | |
| y2 | is the Y coordinate of the new line's ending point. | |
| color | is an XY_color representing the color and transparency of the new line. | |
| thickness | is an XY_fixed representing the thickness of the new line. |
Translate all lines within a collection.
| lines | is an XY_lines pointer containing a collection of lines to translate. | |
| x | is the offset (positive for right, negative for left) by which to translate all of the lines horizontally. | |
| y | is the offset (positive for down, negative for up) by which to translate all of the lines vertically. |
Scale all lines within a collection (centered around the origin (0,0)).
| lines | is an XY_lines pointer containing a collection of lines to scale. | |
| xscale | is the scale to change all of the lines' X coordinates. | |
| yscale | is the scale to change all of the lines' Y coordinates. |
Rotate all lines within a collection (centered around the origin (0,0)).
| lines | is an XY_lines pointer containing a collection of lines to scale. | |
| angle | is angle (in degrees) to rotate each line in the collection. |
1.5.5