我想blit一个图像但由于某种原因pygame显示此错误。有什么想法吗?
import pygame
def main():
pygame.init()
knight = pygame.image.load(r'C:\Users\Sathesh Previn\OneDrive\Game Codes\RPG\Knight Sprite.png')
screen = pygame.display.set_mode((640, 480))
done = False
white = (255, 255, 255)
while done == False:
screen.fill(white)
screen.blit(knight, 100, 100)
pygame.display.update()
main()
答案 0 :(得分:0)
您必须将元组,列表或pygame.Rect作为dest
参数传递给pygame.Surface.blit。
screen.blit(knight, (100, 100))