[英]Typeerror: 'tuple' object is not callable in pygame
当我运行此代码时:
SURFACER = SURFACEFONT.get_rect()
SURFACER.center(400, (ipnum*100))
我收到此错误:
File "index.py", line 62, in <module>
myFunction()
File "index.py", line 55, in drawGamesToScreen
SURFACER.center(400, ipnum*100)
TypeError: 'tuple' object is not callable
在Rect
实例上center
返回一个元组,因此您不能在此处使用.center(x,y)
。 只需分配一个新的元组,如下所示:
SURFACER.center = (400, (ipnum*100))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.