簡體   English   中英

我正在 pygame 中用 python 制作游戲。 當我嘗試加載我的圖片時,我不斷收到此錯誤:“參數 1 必須是 pygame.Surface,而不是 str”

[英]I am making a game with python in pygame. I keep getting this error when I try to load my picture: "argument 1 must be pygame.Surface, not str"

如何修復我的代碼?

image = "r'Applications\\SCHOOL\\ComputerScience\\GAMESUMMATIVE\\galaxyy.jpg"
galaxyPic = pygame.image.load("galaxyy.jpg")   
screen.blit("r'Applications\\SCHOOL\\ComputerScience\\GAMESUMMATIVE\\galaxyy.jpg")
image = pygame.image.load("galaxyy.jpg")

screen.blit(image, (whatever coords you want))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM