pygame.draw.ellipse()

Sintassi

  • pygame.draw.ellipse(surface, color, rect, width=0)
  • pygame.draw.ellipse(surface, color, rect)
  • pygame.draw.ellipse(surface, color, rect, width)

Osserva

  1. Parametri obbligatori: superficie, colore, posizione e dimensioni
  2. width=0, ellisse con riempimento
  3. width > 0, ellisse senza riempimento con tratto specificato

Prova!

import pygame

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.ellipse()")

pygame.draw.ellipse(SCREEN, COLORE, RECT1         )
pygame.draw.ellipse(SCREEN, COLORE, RECT2, width=5)

pygame.display.flip()

Lascia un commento