Skip to content

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) -> Rect

Draw a rectangle on surface.

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) -> Rect

Draw a circle on surface.

def ellipse(surface: Surface, color, rect_arg, width: int = 0) -> Rect

Draw an ellipse inside rect_arg.

def arc(surface: Surface,
color,
rect_arg,
start_angle: float,
stop_angle: float,
width: int = 1) -> Rect

Draw an arc (portion of an ellipse outline).

def line(surface: Surface, color, start_pos, end_pos, width: int = 1) -> Rect

Draw a straight line.

def lines(surface: Surface,
color,
closed: bool,
points: Sequence,
width: int = 1) -> Rect

Draw multiple connected lines.

def aaline(surface: Surface, color, start_pos, end_pos) -> Rect

Draw an anti-aliased line (Wu’s algorithm).

def aalines(surface: Surface, color, closed: bool, points: Sequence) -> Rect

Draw multiple connected anti-aliased lines.

def polygon(surface: Surface, color, points: Sequence, width: int = 0) -> Rect

Draw a polygon.