Corrige draw.py

master
Bertrand Benjamin 5 years ago
parent 354437d48d
commit 1bb6025164
  1. 11
      ISN/pygame/draw.py

@ -33,17 +33,18 @@ while running:
pygame.draw.ellipse(windowSurface, RED, (300, 250, 40,80), 1)
pygame.draw.rect(windowSurface, color_border,
(text_rect.left - 20, text_rect.top - 20,
text_rect.width + 40, text_rect.height + 40)
)
basic_font = pygame.font.SysFont(None, 48)
text = basic_font.render('Hello world!', True, color_text ,BLUE)
text_rect = text.get_rect()
text_rect.centerx = windowSurface.get_rect().centerx
text_rect.centery = windowSurface.get_rect().centery
pygame.draw.rect(windowSurface, color_border,
(text_rect.left - 20, text_rect.top - 20,
text_rect.width + 40, text_rect.height + 40)
)
windowSurface.blit(text, text_rect)
pygame.display.update()

Loading…
Cancel
Save