... | @@ -18,4 +18,26 @@ geom = canvas.compile() |
... | @@ -18,4 +18,26 @@ geom = canvas.compile() |
|
# then you can pass all shapes in one go to the batch draw.
|
|
# then you can pass all shapes in one go to the batch draw.
|
|
batch = batch_for_shader(shader, 'TRIS', {"pos": geom.vectors, "color": geom.vertex_colors}, indices=geom.indices)
|
|
batch = batch_for_shader(shader, 'TRIS', {"pos": geom.vectors, "color": geom.vertex_colors}, indices=geom.indices)
|
|
batch.draw(shader)
|
|
batch.draw(shader)
|
|
|
|
```
|
|
|
|
|
|
|
|
the following shapes are not yet implemented
|
|
|
|
```python
|
|
|
|
def add_rect_rounded(self, x, y, w, h, color, radius=0, precision=5):
|
|
|
|
...
|
|
|
|
|
|
|
|
def add_line(self, x1, y1, x2, y2, width, color):
|
|
|
|
...
|
|
|
|
|
|
|
|
def add_polyline(self, path, width, color):
|
|
|
|
...
|
|
|
|
|
|
|
|
def add_bezier(self, controls, width, color, samples=20, resampled=False):
|
|
|
|
...
|
|
|
|
|
|
|
|
def add_circle(self, x, y, radius, color, precision=32):
|
|
|
|
...
|
|
|
|
|
|
|
|
def add_arc(self, x, y, start_angle, end_angle, radius, width, color, precision=32):
|
|
|
|
...
|
|
|
|
|
|
``` |
|
``` |
|
|
|
\ No newline at end of file |