ipygame.gfxdraw
pygame-compatible gfxdraw module.
def pixel(surface: Surface, x: int, y: int, color) -> NoneDraw a single pixel.
def hline(surface: Surface, x1: int, x2: int, y: int, color) -> NoneDraw a horizontal line.
def vline(surface: Surface, x: int, y1: int, y2: int, color) -> NoneDraw a vertical line.
def line(surface: Surface, x1: int, y1: int, x2: int, y2: int, color) -> NoneDraw a line between two points.
rectangle
Section titled “rectangle”def rectangle(surface: Surface, rect, color) -> NoneDraw an unfilled rectangle.
def box(surface: Surface, rect, color) -> NoneDraw a filled rectangle.
circle
Section titled “circle”def circle(surface: Surface, x: int, y: int, r: int, color) -> NoneDraw an unfilled circle (Midpoint algorithm).
aacircle
Section titled “aacircle”def aacircle(surface: Surface, x: int, y: int, r: int, color) -> NoneDraw an anti-aliased circle.
filled_circle
Section titled “filled_circle”def filled_circle(surface: Surface, x: int, y: int, r: int, color) -> NoneDraw a filled circle.
ellipse
Section titled “ellipse”def ellipse(surface: Surface, x: int, y: int, rx: int, ry: int, color) -> NoneDraw an unfilled ellipse.
aaellipse
Section titled “aaellipse”def aaellipse(surface: Surface, x: int, y: int, rx: int, ry: int, color) -> NoneDraw an anti-aliased ellipse.
filled_ellipse
Section titled “filled_ellipse”def filled_ellipse(surface: Surface, x: int, y: int, rx: int, ry: int, color) -> NoneDraw a filled ellipse.
def arc(surface: Surface, x: int, y: int, r: int, start_angle: int, end_angle: int, color) -> NoneDraw an arc (start/end in degrees).
def pie(surface: Surface, x: int, y: int, r: int, start_angle: int, end_angle: int, color) -> NoneDraw a pie slice (filled arc with lines to center).
trigon
Section titled “trigon”def trigon(surface: Surface, x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, color) -> NoneDraw an unfilled triangle.
aatrigon
Section titled “aatrigon”def aatrigon(surface: Surface, x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, color) -> NoneDraw an anti-aliased triangle.
filled_trigon
Section titled “filled_trigon”def filled_trigon(surface: Surface, x1: int, y1: int, x2: int, y2: int, x3: int, y3: int, color) -> NoneDraw a filled triangle.
polygon
Section titled “polygon”def polygon(surface: Surface, points, color) -> NoneDraw an unfilled polygon.
aapolygon
Section titled “aapolygon”def aapolygon(surface: Surface, points, color) -> NoneDraw an anti-aliased polygon outline.
filled_polygon
Section titled “filled_polygon”def filled_polygon(surface: Surface, points, color) -> NoneDraw a filled polygon using scanline fill.
bezier
Section titled “bezier”def bezier(surface: Surface, points, steps: int, color) -> NoneDraw a Bezier curve through control points.
textured_polygon
Section titled “textured_polygon”def textured_polygon(surface: Surface, points, texture: Surface, tx: int, ty: int) -> NoneDraw a textured polygon (simplified — draws filled with texture tiling).