Sintassi
pygame.draw.arc(surface, color, rect, start_angle, stop_angle, width=1)
pygame.draw.arc(surface, color, rect, start_angle, stop_angle)
pygame.draw.arc(surface, color, rect, start_angle, stop_angle, width)
Osserva
- Disegna archi di ellisse
- Parametri obbligatori: superficie, colore, posizione e dimensioni, angolo di partenza, angolo di arrivo
width >= 1
, il parametro facoltativo specifica lo spessore del tratto
Prova!
import pygame
from math import pi as PI
RECT1 = pygame.Rect((100, 100), (400, 200))
RECT2 = pygame.Rect((300, 300), (400, 200))
COLORE = (0, 255, 0)
pygame.init()
screen=pygame.display.set_mode((800, 600))
pygame.display.set_caption("pygame.draw.arc()")
pygame.draw.arc(screen, COLORE, RECT1, start_angle=0 , stop_angle =PI )
pygame.draw.arc(screen, COLORE, RECT2, start_angle=PI, stop_angle =2*PI, width=5)
pygame.display.flip()