【发布时间】:2018-09-29 03:04:41
【问题描述】:
我正在尝试在 Pygame 的屏幕上显示分数。
这里是文本函数。执行时显示“**AttributeError: 'pygame.Surface' object has no attribute 'get'”* 感谢您的帮助!
def text(self, surface, text, size, x, y):
font= pg.font.Font(self.font_name, size)
text_surface = font.render(text, True, WHITE )
text_rect= text_surface.get.rect()
text.rect.midtop = (x,y)
self.screen.blit(text_surface, text_rect)
【问题讨论】: