def test_get_alpha(self):
# __doc__ (as of 2008-06-25) for pygame.surface.Surface.get_alpha:
# Surface.get_alpha(): return int_value or None
# get the current Surface transparency value
s1 = pygame.Surface((32,32), pygame.SRCALPHA, 32)
self.assert_(s1.get_alpha() == 255)
for alpha in (0, 32, 127, 255):
s1.set_alpha(alpha)
for t in range(4): s1.set_alpha(s1.get_alpha())
self.assert_(s1.get_alpha() == alpha)
########################################################################
评论列表
文章目录