首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解析: TypeError:参数1必须为pygame.Surface,而不是builtin_function_or_method

如何解析: TypeError:参数1必须为pygame.Surface,而不是builtin_function_or_method
EN

Stack Overflow用户
提问于 2018-06-05 08:15:47
回答 1查看 523关注 0票数 1
代码语言:javascript
复制
import pygame

BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)

pygame.init()

size = (800, 625)
screen = pygame.display.set_mode(size)

pygame.display.set_caption("Game of Ur")
Token = pygame.image.load("chip.png").convert
board = pygame.image.load("board.png").convert

done = False


clock = pygame.time.Clock()

while not done:

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True

    screen.fill(WHITE)
    screen.blit(board,[0,0])

    pygame.display.flip()

    clock.tick(60)


pygame.quit()

我得到了错误

代码语言:javascript
复制
Traceback (most recent call last):
  File "C:\Users\Ed\Documents\thonk\game.py", line 43, in <module>
  screen.blit(board,[0,0])
TypeError: argument 1 must be pygame.Surface, not builtin_function_or_method

我该如何解决这个问题?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50690386

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档