surface_test.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:Projects 作者: it2school 项目源码 文件源码
def test_copy(self):

        # __doc__ (as of 2008-06-25) for pygame.surface.Surface.copy:

          # Surface.copy(): return Surface
          # create a new copy of a Surface

        color = (25, 25, 25, 25)
        s1 = pygame.Surface((32,32), pygame.SRCALPHA, 32)
        s1.fill(color)

        s2 = s1.copy()

        s1rect = s1.get_rect()
        s2rect = s2.get_rect()

        self.assert_(s1rect.size == s2rect.size)
        self.assert_(s2.get_at((10,10)) == color)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号