【发布时间】:2014-01-04 11:17:43
【问题描述】:
这些是相关的代码部分:
class t_color(object):
BLUE = (0, 0, 255)
GREY = (128, 128, 128)
GREEN = (0, 128, 0)
LIME = (0, 255, 0)
PURPLE = (128, 0, 128)
RED = (255, 0, 0)
SILVER = (192, 192, 192)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
YELLOW = (255, 255, 0)
IMAGE_ALPHA = t_color.BLACK
...
img = pygame.image.load('images/' + str(i) + '.bmp')
img.set_colorkey(IMAGE_ALPHA)
g.images.append(img)
在 Windows 上,这工作正常。现在我使用的是 Mac (10.9) 和 python 2.7.5(在 windows 上我有 2.7.6)pygame 1.9.2(在 windows 上我有 1.9.1)
这是我正在使用的图片,它们只有 32x32 像素:http://www.mediafire.com/download/nf9exc8trged687/images.zip
我想将黑色设置为透明,因为图像是 BMP 文件并且不支持透明度。
有谁知道这是什么原因造成的或如何解决?
【问题讨论】:
-
/other中的图像没有用于 alpha,它只是我游戏的一部分。 -
在 linux 上使用 1.9.1 对我来说很好。
-
我知道,它在 windows 上也适用于我,只是在 mac 上不行:\
-
你在mac上试过pygame 1.9.1版本而不是1.9.2吗?
-
无法安装 1.9.1,安装程序说我需要 python 2.7?即使我有 2.7.5。 ://
标签: python windows macos pygame alpha