Skip to content

ipygame.gfxdraw

pygame-compatible gfxdraw module.

def pixel(surface: Surface, x: int, y: int, color) -> None

Draw a single pixel.

def hline(surface: Surface, x1: int, x2: int, y: int, color) -> None

Draw a horizontal line.

def vline(surface: Surface, x: int, y1: int, y2: int, color) -> None

Draw a vertical line.

def line(surface: Surface, x1: int, y1: int, x2: int, y2: int, color) -> None

Draw a line between two points.

def rectangle(surface: Surface, rect, color) -> None

Draw an unfilled rectangle.

def box(surface: Surface, rect, color) -> None

Draw a filled rectangle.

def circle(surface: Surface, x: int, y: int, r: int, color) -> None

Draw an unfilled circle (Midpoint algorithm).

def aacircle(surface: Surface, x: int, y: int, r: int, color) -> None

Draw an anti-aliased circle.

def filled_circle(surface: Surface, x: int, y: int, r: int, color) -> None

Draw a filled circle.

def ellipse(surface: Surface, x: int, y: int, rx: int, ry: int, color) -> None

Draw an unfilled ellipse.

def aaellipse(surface: Surface, x: int, y: int, rx: int, ry: int,
color) -> None

Draw an anti-aliased ellipse.

def filled_ellipse(surface: Surface, x: int, y: int, rx: int, ry: int,
color) -> None

Draw a filled ellipse.

def arc(surface: Surface, x: int, y: int, r: int, start_angle: int,
end_angle: int, color) -> None

Draw an arc (start/end in degrees).

def pie(surface: Surface, x: int, y: int, r: int, start_angle: int,
end_angle: int, color) -> None

Draw a pie slice (filled arc with lines to center).

def trigon(surface: Surface, x1: int, y1: int, x2: int, y2: int, x3: int,
y3: int, color) -> None

Draw an unfilled triangle.

def aatrigon(surface: Surface, x1: int, y1: int, x2: int, y2: int, x3: int,
y3: int, color) -> None

Draw an anti-aliased triangle.

def filled_trigon(surface: Surface, x1: int, y1: int, x2: int, y2: int,
x3: int, y3: int, color) -> None

Draw a filled triangle.

def polygon(surface: Surface, points, color) -> None

Draw an unfilled polygon.

def aapolygon(surface: Surface, points, color) -> None

Draw an anti-aliased polygon outline.

def filled_polygon(surface: Surface, points, color) -> None

Draw a filled polygon using scanline fill.

def bezier(surface: Surface, points, steps: int, color) -> None

Draw a Bezier curve through control points.

def textured_polygon(surface: Surface, points, texture: Surface, tx: int,
ty: int) -> None

Draw a textured polygon (simplified — draws filled with texture tiling).