ipygame.draw
pygame-compatible drawing functions.
def rect(surface: Surface, color, rect_arg, width: int = 0, border_radius: int = -1, border_top_left_radius: int = -1, border_top_right_radius: int = -1, border_bottom_left_radius: int = -1, border_bottom_right_radius: int = -1) -> RectDraw a rectangle on surface.
circle
Section titled “circle”def circle(surface: Surface, color, center, radius: int, width: int = 0, draw_top_right: bool | None = None, draw_top_left: bool | None = None, draw_bottom_left: bool | None = None, draw_bottom_right: bool | None = None) -> RectDraw a circle on surface.
ellipse
Section titled “ellipse”def ellipse(surface: Surface, color, rect_arg, width: int = 0) -> RectDraw an ellipse inside rect_arg.
def arc(surface: Surface, color, rect_arg, start_angle: float, stop_angle: float, width: int = 1) -> RectDraw an arc (portion of an ellipse outline).
def line(surface: Surface, color, start_pos, end_pos, width: int = 1) -> RectDraw a straight line.
def lines(surface: Surface, color, closed: bool, points: Sequence, width: int = 1) -> RectDraw multiple connected lines.
aaline
Section titled “aaline”def aaline(surface: Surface, color, start_pos, end_pos) -> RectDraw an anti-aliased line (Wu’s algorithm).
aalines
Section titled “aalines”def aalines(surface: Surface, color, closed: bool, points: Sequence) -> RectDraw multiple connected anti-aliased lines.
polygon
Section titled “polygon”def polygon(surface: Surface, color, points: Sequence, width: int = 0) -> RectDraw a polygon.