[英]What do I put inside a pygame.Surface()?
block1 = pygame.Surface(?,?)
when I ran it it gave me an error stating 当我运行它给我一个错误说明
ValueError: size needs to be (int width, int height)
ValueError:大小必须为(整数宽度,整数高度)
The first argument of pygame.Surface
is a tuple which represents the size of the surface. pygame.Surface
的第一个参数是一个表示表面尺寸的元组。 Therefore, you need to provide these arguments when calling it: 因此,在调用它时需要提供以下参数:
width = 600
height = 400
block1 = pygame.Surface((width, height))
pygame.Surface((width, height), flags=0, depth=0, masks=None) -> Surface
阅读文档确实有助于理解它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.