class DrawLine(DrawCommand): """Draws a line.""" p1: Pos2D = DrawPropertyPos() p2: Pos2D = DrawPropertyPos() color: ColorRGBA = DrawPropertyColorRGBA() thickness: int = DrawProperty() def _draw_internal(self, draw_args) -> None: dpgcore.draw_line(self.canvas.id, tag=self.id, **draw_args)
class DrawArrow(DrawCommand): """Draw a line with an arrowhead.""" p1: Pos2D = DrawPropertyPos() p2: Pos2D = DrawPropertyPos() color: ColorRGBA = DrawPropertyColorRGBA() thickness: int = DrawProperty() arrow_size: int = DrawProperty(key='size') def _draw_internal(self, draw_args) -> None: dpgcore.draw_arrow(self.canvas.id, tag=self.id, **draw_args)
class DrawTriangle(DrawCommand): """Draws a triangle.""" p1: Pos2D = DrawPropertyPos() p2: Pos2D = DrawPropertyPos() p3: Pos2D = DrawPropertyPos() color: ColorRGBA = DrawPropertyColorRGBA() fill: ColorRGBA = DrawPropertyColorRGBA() thickness: float = DrawProperty() def _draw_internal(self, draw_args) -> None: dpgcore.draw_triangle(self.canvas.id, tag=self.id, **draw_args)
class DrawRectangle(DrawCommand): """Draws a rectangle.""" pmin: Pos2D = DrawPropertyPos() pmax: Pos2D = DrawPropertyPos() color: ColorRGBA = DrawPropertyColorRGBA() fill: ColorRGBA = DrawPropertyColorRGBA() rounding: float = DrawProperty() thickness: float = DrawProperty() def _draw_internal(self, draw_args) -> None: dpgcore.draw_rectangle(self.canvas.id, tag=self.id, **draw_args)
class DrawBezierCurve(DrawCommand): """Draws a bezier curve.""" p1: Pos2D = DrawPropertyPos() p2: Pos2D = DrawPropertyPos() p3: Pos2D = DrawPropertyPos() p4: Pos2D = DrawPropertyPos() color: ColorRGBA = DrawPropertyColorRGBA() thickness: float = DrawProperty() segments: int = DrawProperty() def _draw_internal(self, draw_args) -> None: dpgcore.draw_bezier_curve(self.canvas.id, tag=self.id, **draw_args)
class DrawQuad(DrawCommand): """Draws a quadrilateral.""" p1: Pos2D = DrawPropertyPos() p2: Pos2D = DrawPropertyPos() p3: Pos2D = DrawPropertyPos() p4: Pos2D = DrawPropertyPos() color: ColorRGBA = DrawPropertyColorRGBA() fill: ColorRGBA = DrawPropertyColorRGBA() thickness: float = DrawProperty() def _draw_internal(self, draw_args) -> None: dpgcore.draw_quad(self.canvas.id, tag=self.id, **draw_args)
class DrawText(DrawCommand): """Draws text.""" pos: Pos2D = DrawPropertyPos() text: str = DrawProperty() color: ColorRGBA = DrawPropertyColorRGBA() font_size: int = DrawProperty(key='size') def _draw_internal(self, draw_args) -> None: dpgcore.draw_text(self.canvas.id, tag=self.id, **draw_args)
class DrawCircle(DrawCommand): """Draws a circle.""" center: Pos2D = DrawPropertyPos() radius: float = DrawProperty() color: ColorRGBA = DrawPropertyColorRGBA() segments: int = DrawProperty() thickness: float = DrawProperty() fill: ColorRGBA = DrawPropertyColorRGBA() def _draw_internal(self, draw_args) -> None: dpgcore.draw_circle(self.canvas.id, tag=self.id, **draw_args)