你好,我们的社区!!你知道吗
我在这个社区做了很长时间的浏览者,但还是第一次做海报。 我发帖只是因为我也很绝望。当我在pygame中导入图像时,某些图像会变得一团糟,无法修复。我用内置的pygame.image.load文件(文件名)奇怪的灰度图像是JPG,奇怪的像素化图像是PNG。我不会以任何有意义的方式变换图片,除非我试图修复bug。我将在下面提供相关代码。非常感谢你的帮助,这意味着很多
class Alarm(MySprite):
def __init__(self,image,x,y,radius,boundaries = None):
MySprite.__init__(self,image,x,y)
self.radius = radius
def draw(self,screen):
MySprite.draw(self,screen)
self.fireAlarmImage = pygame.image.load("fireAlarm.png")
if self.editing:
self.background = Background(
"editing_background%d.jpg"%(self.level), True)
def set_background(self, picture = None):
if picture:
self.background = pygame.image.load(picture).convert_alpha()
Weird Perspective/Greyscale/ParticiallyDuplicated/Shifted Pygame Version
我通过卸载python和pygame并重新安装修复了这个错误。你知道吗
相关问题 更多 >
编程相关推荐