Corrige draw.py
This commit is contained in:
parent
354437d48d
commit
1bb6025164
@ -33,17 +33,18 @@ while running:
|
|||||||
|
|
||||||
pygame.draw.ellipse(windowSurface, RED, (300, 250, 40,80), 1)
|
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)
|
basic_font = pygame.font.SysFont(None, 48)
|
||||||
text = basic_font.render('Hello world!', True, color_text ,BLUE)
|
text = basic_font.render('Hello world!', True, color_text ,BLUE)
|
||||||
text_rect = text.get_rect()
|
text_rect = text.get_rect()
|
||||||
text_rect.centerx = windowSurface.get_rect().centerx
|
text_rect.centerx = windowSurface.get_rect().centerx
|
||||||
text_rect.centery = windowSurface.get_rect().centery
|
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)
|
windowSurface.blit(text, text_rect)
|
||||||
|
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
Loading…
Reference in New Issue
Block a user