Learn Before
Code
Drawing Lines in Pygame
The draw.line() function allows you to draw a line from a start point to an endpoint. The function takes in the surface, color, tuple storing the xy coordinates for the start position, another tuple for the end position, and optional width. The width is used to determine line thickness, starting at 1. If the width is less than 1, the line will not be drawn.
displaySurface = pygame.display.set_mode((1920, 1080)) displayColor = (0, 0, 0) start_pos = (10, 10) end_pos = (20, 20) width = 1 pygame.draw.arc(displaySurface, displayColor, start_pos, end_pos, width)
0
1
Updated 2021-06-21
Tags
Python Programming Language
Data Science