📜  pygame 渲染文本 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:33.450000             🧑  作者: Mango

代码示例2
"""system font"""
font = pygame.font.SysFont("Segoe UI", 35)

"""font from .ttf file"""
font = pygame.font.Font("path/to/font.ttf", 35)

textsurface = font.render("text", False, color)  # "text", antialias, color
surface.blit(textsurface, (x, y))