简体   繁体   English

pygame.transform.rotate错误

[英]Pygame.transform.rotate error

I am attempting to scale a surface in pygame but I am getting this error: 我正在尝试在pygame中缩放表面,但出现此错误:

pygame.transform.scale(sprite.getSurface(), math.radians(sprite.getFaceAngle()))
TypeError: must be 2-item sequence, not float

My code is as follows: 我的代码如下:

pygame.transform.scale(sprite.getSurface(), math.radians(sprite.getFaceAngle()))

The error is pretty self-explanatory. 该错误是不言自明的。 http://www.pygame.org/docs/ref/transform.html#pygame.transform.scale says the second argument should be (width, height). http://www.pygame.org/docs/ref/transform.html#pygame.transform.scale表示第二个参数应为(宽度,高度)。 math.radians() only returns a float. math.radians()仅返回浮点数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM