2024-03-29 08:08:21 发布
网友
在pygame中,如何在屏幕上绘制ascii字符? 我所能找到的就是如何绘制矩形: pygame.draw.rect(screen, color, (x,y,width,height), thickness)。
pygame.draw.rect(screen, color, (x,y,width,height), thickness)
我想知道有没有办法在屏幕上画一个像“a”这样的字符,然后让它出现在屏幕上。
谢谢。
我会这样做的:
font = pygame.font.Font(<Font>, 36) text = font.render("<Char>", 1, (10, 10, 10)) textpos = text.get_rect() <Surface>.blit(text, textpos)
编辑:注意大/小符号之间的名称是占位符。。。在
我会这样做的:
编辑:注意大/小符号之间的名称是占位符。。。在
相关问题 更多 >
编程相关推荐