font = pygame.font.Font('freesansbold.ttf', 32) text = font.render(text, True, textColor, backgroundColor) textRect = text.get_rect() textRect.center = (x,y) screen.blit(text, textRect) pygame.display.update()
font = pygame.font.Font("PATH_TO_FONT", PX_SIZE) textsurface = font.render("TEXT", False, COLOR) # "text", antialias, color surface.blit(textsurface, (x, y))
pygame.font.init() # you have to call this at the start, # if you want to use this module. myfont = pygame.font.SysFont('Comic Sans MS', 30) textsurface = myfont.render('Some Text', False, (0, 0, 0)) screen.blit(textsurface,(0,0))