Answers for "center text pygame"

0

pygame center text in rect

# draw text
font = pygame.font.Font(None, 25)
text = font.render("You win!", True, BLACK)
text_rect = text.get_rect(center=(SCREEN_WIDTH/2, SCREEN_HEIGHT/2))
screen.blit(text, text_rect)
Posted by: Guest on October-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language