当前位置:   article > 正文

pygame编组(精灵组)Group中的常用方法介绍

pygame group

说明:

1.以下所用的Group均为Group类的对象实例

2.Group类是对AbstractGroup类的继承

sprite.py文档中描述如下:

class Group(AbstractGroup):
    """container class for many Sprites

    pygame.sprite.Group(*sprites): return Group

    A simple container for Sprite objects. This class can be subclassed to
    create containers with more specific behaviors. The constructor takes any
    number of Sprite arguments to add to the Group. The group supports the
    following standard Python operations:

        in      test if a Sprite is contained
        len     the number of Sprites contained
        bool    test if any Sprites are contained
        iter    iterate through all the Sprites

    The Sprites in the Group are not ordered, so the Sp
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/340241
推荐阅读
相关标签
  

闽ICP备14008679号