0

The following code is trying to display simple text on the pygame window, but it gets an error saying render() takes no keyword arguments.

font = pygame.font.Font(pygame.font.get_default_font(), 36)
text_surface = font.render('Hello world', antialias=True, color=(0, 0, 0))
display.blit(text_surface, dest=(0,0))
Blue
  • 21
  • 4
  • 1
    What is the question? Yes [`render()`](https://www.pygame.org/docs/ref/font.html#pygame.font.Font.render) doesn't allow keyword arguments. – Rabbid76 Mar 04 '21 at 05:25

1 Answers1

1

Many people met this problem.

Just do not use a keyword argument.

text_surface = font.render('Hello world',True, (0, 0, 0))
Frank
  • 1,051
  • 9
  • 22