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