0
我刚开始使用PyGame,我试图让消息显示玩家输了,但是我收到错误。PyGame错误:RGBA参数
red = (2555, 0, 0)
font = pygame.font.SysFont(None, 25)
def message_to_screen(msg,color):
screen_text = font.render(msg, True, color)
gameDisplay.blit(screen_text, [display_width/2, display_height/2])
--etc等
message_to_screen("You Lose", red)
pygame.display.update()
time.sleep(2)
确切的错误信息是
screen_text = font.render(msg, True, color)
TypeError: Invalid foreground RGBA argument
我不能找到任何答案。请帮忙!
每个通道的范围为0到255. 2555太大。 – Arkia