zscript-doc/api/drawing/Shape2D.md

38 lines
803 B
Markdown
Raw Permalink Normal View History

2018-12-29 16:05:19 -08:00
# Shape2D
Represents an arbitrary polygonal 2D shape.
```
class Shape2D : Object
2018-12-29 16:05:19 -08:00
{
2019-08-14 03:32:51 -07:00
void Clear(int which = C_Verts | C_Coords | C_Indices);
void PushCoord(vector2 c);
void PushTriangle(int a, int b, int c);
void PushVertex(vector2 v);
2018-12-29 16:05:19 -08:00
}
```
2019-08-14 03:31:41 -07:00
### `Clear`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Clears data out of a shape. Uses these as a bit flag:
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
| Name | Description |
| ---- | ----------- |
| `Shape2D.C_Coords` | Clears texture coordinates. |
| `Shape2D.C_Indices` | Clears vertex indices. |
| `Shape2D.C_Verts` | Clears vertices. |
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `PushCoord`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Pushes a texture coordinate into the shape buffer.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `PushTriangle`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Pushes the indices of a triangle into the shape buffer.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `PushVertex`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Pushes a vertex into the shape buffer.
2018-12-29 16:05:19 -08:00
<!-- EOF -->