图像加载blit的无效目标位置

时间:2017-10-03 11:38:59

标签: python pygame

我想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()

1 个答案:

答案 0 :(得分:0)

您必须将元组,列表或pygame.Rect作为dest参数传递给pygame.Surface.blit

screen.blit(knight, (100, 100))