# {py:mod}`simvx.graphics.draw2d` ```{py:module} simvx.graphics.draw2d ``` ```{autodoc2-docstring} simvx.graphics.draw2d :allowtitles: ``` ## Module Contents ### Classes ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`Draw2D ` - ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D :summary: ``` ```` ### Data ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`__all__ ` - ```{autodoc2-docstring} simvx.graphics.draw2d.__all__ :summary: ``` ```` ### API ````{py:data} __all__ :canonical: simvx.graphics.draw2d.__all__ :value: > ['Draw2D', 'UI_VERTEX_DTYPE'] ```{autodoc2-docstring} simvx.graphics.draw2d.__all__ ``` ```` `````{py:class} Draw2D :canonical: simvx.graphics.draw2d.Draw2D Bases: {py:obj}`simvx.graphics.draw2d_transform.Draw2DTransformMixin`, {py:obj}`simvx.graphics.draw2d_text.Draw2DTextMixin`, {py:obj}`simvx.graphics.draw2d_texture.Draw2DTextureMixin`, {py:obj}`simvx.graphics.draw2d_batch.Draw2DBatchMixin` ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D ``` ````{py:method} set_colour(r=255, g=255, b=255, a=255) :canonical: simvx.graphics.draw2d.Draw2D.set_colour :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.set_colour ``` ```` ````{py:method} fill_rect(pos, size_or_y=None, w=None, h=None) :canonical: simvx.graphics.draw2d.Draw2D.fill_rect :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.fill_rect ``` ```` ````{py:method} draw_rect(pos, size_or_y=None, w=None, h=None, colour=None) :canonical: simvx.graphics.draw2d.Draw2D.draw_rect :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_rect ``` ```` ````{py:method} draw_line(a, b_or_y=None, x2=None, y2=None) :canonical: simvx.graphics.draw2d.Draw2D.draw_line :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_line ``` ```` ````{py:method} draw_lines(points, closed=True, colour=None) :canonical: simvx.graphics.draw2d.Draw2D.draw_lines :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_lines ``` ```` ````{py:method} draw_circle(center, radius_or_y=None, radius=None, segments=24, colour=None) :canonical: simvx.graphics.draw2d.Draw2D.draw_circle :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_circle ``` ```` ````{py:method} fill_triangle(x1, y1, x2, y2, x3, y3) :canonical: simvx.graphics.draw2d.Draw2D.fill_triangle :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.fill_triangle ``` ```` ````{py:method} draw_polygon(vertices, colour=None) :canonical: simvx.graphics.draw2d.Draw2D.draw_polygon :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_polygon ``` ```` ````{py:method} fill_quad(x1, y1, x2, y2, x3, y3, x4, y4) :canonical: simvx.graphics.draw2d.Draw2D.fill_quad :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.fill_quad ``` ```` ````{py:method} draw_thick_line(x1, y1, x2, y2, width=2.0) :canonical: simvx.graphics.draw2d.Draw2D.draw_thick_line :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_thick_line ``` ```` ````{py:method} fill_circle(cx, cy, radius, segments=24) :canonical: simvx.graphics.draw2d.Draw2D.fill_circle :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.fill_circle ``` ```` ````{py:method} draw_thick_line_coloured(x1, y1, x2, y2, width, colour) :canonical: simvx.graphics.draw2d.Draw2D.draw_thick_line_coloured :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_thick_line_coloured ``` ```` ````{py:method} draw_filled_circle(cx, cy, radius, colour, segments=24) :canonical: simvx.graphics.draw2d.Draw2D.draw_filled_circle :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_filled_circle ``` ```` ````{py:method} draw_filled_triangle(x1, y1, x2, y2, x3, y3, colour) :canonical: simvx.graphics.draw2d.Draw2D.draw_filled_triangle :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_filled_triangle ``` ```` ````{py:method} draw_filled_quad(x1, y1, x2, y2, x3, y3, x4, y4, colour) :canonical: simvx.graphics.draw2d.Draw2D.draw_filled_quad :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_filled_quad ``` ```` ````{py:method} fill_rect_gradient(x, y, w, h, colour_top, colour_bottom) :canonical: simvx.graphics.draw2d.Draw2D.fill_rect_gradient :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.fill_rect_gradient ``` ```` ````{py:method} draw_gradient_rect(x, y, w, h, colour_top, colour_bottom) :canonical: simvx.graphics.draw2d.Draw2D.draw_gradient_rect :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_gradient_rect ``` ```` ````{py:method} draw_filled_rect(x, y, w, h, colour) :canonical: simvx.graphics.draw2d.Draw2D.draw_filled_rect :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_filled_rect ``` ```` ````{py:method} draw_rect_coloured(x, y, w, h, colour) :canonical: simvx.graphics.draw2d.Draw2D.draw_rect_coloured :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_rect_coloured ``` ```` ````{py:method} draw_line_coloured(x1, y1, x2, y2, colour) :canonical: simvx.graphics.draw2d.Draw2D.draw_line_coloured :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.draw_line_coloured ``` ```` ````{py:method} clear(r=0, g=0, b=0) :canonical: simvx.graphics.draw2d.Draw2D.clear :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.clear ``` ```` ````{py:method} present() :canonical: simvx.graphics.draw2d.Draw2D.present :classmethod: ```{autodoc2-docstring} simvx.graphics.draw2d.Draw2D.present ``` ```` ````{py:method} push_transform(a, b, c, d, tx, ty) :canonical: simvx.graphics.draw2d.Draw2D.push_transform :classmethod: ```` ````{py:method} pop_transform() :canonical: simvx.graphics.draw2d.Draw2D.pop_transform :classmethod: ```` ````{py:method} push_identity() :canonical: simvx.graphics.draw2d.Draw2D.push_identity :classmethod: ```` ````{py:method} set_font(path: str | None = None, size: int = 48) -> None :canonical: simvx.graphics.draw2d.Draw2D.set_font :classmethod: ```` ````{py:method} draw_text(text, pos, scale=1, colour=None) :canonical: simvx.graphics.draw2d.Draw2D.draw_text :classmethod: ```` ````{py:method} text_width(text, scale=1) :canonical: simvx.graphics.draw2d.Draw2D.text_width :classmethod: ```` ````{py:method} draw_text_coloured(text, x, y, scale=1, colour=None) :canonical: simvx.graphics.draw2d.Draw2D.draw_text_coloured :classmethod: ```` ````{py:method} register_texture(png_data: bytes) -> int :canonical: simvx.graphics.draw2d.Draw2D.register_texture :classmethod: ```` ````{py:method} register_texture_with_id(texture_id: int, png_data: bytes) -> None :canonical: simvx.graphics.draw2d.Draw2D.register_texture_with_id :classmethod: ```` ````{py:method} draw_texture(texture_id: int, x: float, y: float, w: float, h: float, colour: tuple[float, ...] | None = None, rotation: float = 0.0) :canonical: simvx.graphics.draw2d.Draw2D.draw_texture :classmethod: ```` ````{py:method} draw_texture_region(texture_id: int, x: float, y: float, w: float, h: float, u0: float = 0.0, v0: float = 0.0, u1: float = 1.0, v1: float = 1.0, colour: tuple[float, ...] | None = None, rotation: float = 0.0) :canonical: simvx.graphics.draw2d.Draw2D.draw_texture_region :classmethod: ```` ````{py:method} draw_nine_patch(texture_id: int, x: float, y: float, w: float, h: float, tex_w: float, tex_h: float, margin_left: float = 0.0, margin_right: float = 0.0, margin_top: float = 0.0, margin_bottom: float = 0.0, draw_centre: bool = True, colour: tuple[float, ...] | None = None) :canonical: simvx.graphics.draw2d.Draw2D.draw_nine_patch :classmethod: ```` ````{py:method} push_clip(x: int, y: int, w: int, h: int) :canonical: simvx.graphics.draw2d.Draw2D.push_clip :classmethod: ```` ````{py:method} pop_clip() :canonical: simvx.graphics.draw2d.Draw2D.pop_clip :classmethod: ```` ````{py:method} new_layer() :canonical: simvx.graphics.draw2d.Draw2D.new_layer :classmethod: ```` ````{py:method} reset_clip() :canonical: simvx.graphics.draw2d.Draw2D.reset_clip :classmethod: ```` `````