[Pygame] Add text to the Pygame screen

font = pygame.font.SysFont("freesansbold.ttf", 30)	# 30:font size
text = font.render("content", True, (0,0,0))	# (0,0,0) color of font
self.window.blit(text,(10,10))	# (10,10) rect left top

Guess you like

Origin blog.csdn.net/ao1886/article/details/111395671