def test_fill(self):
# __doc__ (as of 2008-06-25) for pygame.surface.Surface.fill:
# Surface.fill(color, rect=None, special_flags=0): return Rect
# fill Surface with a solid color
color = (25, 25, 25, 25)
fill_rect = pygame.Rect(0, 0, 16, 16)
s1 = pygame.Surface((32,32), pygame.SRCALPHA, 32)
s1.fill(color, fill_rect)
for pt in test_utils.rect_area_pts(fill_rect):
self.assert_(s1.get_at(pt) == color )
for pt in test_utils.rect_outer_bounds(fill_rect):
self.assert_(s1.get_at(pt) != color )
评论列表
文章目录