我试图在pygame中将一个列表放到一个表面上,但是prompts = contactFont.render(fields, True, (171,0,0))
行导致了上述错误,我不知道为什么。
class AddPage(Page):
...
def textInputs(self):
fields = ["First Name:", "Last Name:", "Address:", "Mobile:", "Telephone:", "Email:"]
contactFont = pygame.font.SysFont("trebuchet ms", 18)
y = 20
for i in fields:
#Error here
prompts = contactFont.render(fields, True, (171,0,0))
self.intermediate2.blit(prompts, (5,y))
pygame.draw.line(self.intermediate2, (0,0,0), (5, (y+20)), (320, (y+20)), 1)
y += 30
我试着用[x.encode('utf-8') for x in fields]
把fields
列表编码成unicode,但是什么也没发生,怎么了?
目前没有回答
相关问题 更多 >
编程相关推荐