1.画线
line(画在哪个地方, 线的颜色, 起点, 终点, 线宽=1)
pygame.draw.line(window, (0, 255, 0), (10, 10), (100, 100), 4)
2.画线
lines(画在哪个地方, 线的颜色, 是否关闭, 点列表, 线宽=1)
point_list = [(200, 200), (250, 10), (300, 200), (150, 100), (350, 100)]
# pygame.draw.lines(window, (255, 0, 0), True, point_list)
3.画圆
circle(画在哪个地方, 线的颜色,圆心,半径, 线宽=0)
pygame.draw.circle(window, (0, 0, 0), (200, 300), 100, 0)
pygame.draw.circle(window, (255, 0, 0), (200, 300), 90, 0)
4.画多边形
polygon(画在哪个地方,线的颜色, 点列表,线宽)
pygame.draw.polygon(window, (255, 0, 0), point_list, 0)
5.画弧线
arc(画在哪个地方,线的颜色, 矩形, 起始弧度, 终止弧度, 线宽)
pygame.draw.arc(window, (0, 255, 255), (10, 470, 150, 200), math.pi/4, math.pi/4*3, 5)
6.画矩形
pygame.draw.rect(window, (100, 20, 50), (200, 470, 100, 50), 2)
网友评论