python类graphics()的实例源码

__init__.py 文件源码 项目:FightstickDisplay 作者: calexil 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self):
        '''Create a graphics batch.'''
        # Mapping to find domain.  
        # group -> (attributes, mode, indexed) -> domain
        self.group_map = {}

        # Mapping of group to list of children.
        self.group_children = {}

        # List of top-level groups
        self.top_groups = []

        self._draw_list = []
        self._draw_list_dirty = False
sprite.py 文件源码 项目:FightstickDisplay 作者: calexil 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def group(self):
        """Parent graphics group.

        The sprite can change its rendering group, however this can be an
        expensive operation.

        :type: `Group`
        """
        return self._group.parent
sprite.py 文件源码 项目:FightstickDisplay 作者: calexil 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def _create_vertex_list(self):
        if self._subpixel:
            vertex_format = 'v2f/%s' % self._usage
        else:
            vertex_format = 'v2i/%s' % self._usage
        if self._batch is None:
            self._vertex_list = graphics.vertex_list(4, vertex_format,
                'c4B', ('t3f', self._texture.tex_coords))
        else:
            self._vertex_list = self._batch.add(4, GL_QUADS, self._group,
                vertex_format, 'c4B', ('t3f', self._texture.tex_coords))
        self._update_position()
        self._update_color()
__init__.py 文件源码 项目:cryptogram 作者: xinmingzhang 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self):
        '''Create a graphics batch.'''
        # Mapping to find domain.  
        # group -> (attributes, mode, indexed) -> domain
        self.group_map = {}

        # Mapping of group to list of children.
        self.group_children = {}

        # List of top-level groups
        self.top_groups = []

        self._draw_list = []
        self._draw_list_dirty = False
sprite.py 文件源码 项目:cryptogram 作者: xinmingzhang 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def group(self):
        """Parent graphics group.

        The sprite can change its rendering group, however this can be an
        expensive operation.

        :type: `Group`
        """
        return self._group.parent
sprite.py 文件源码 项目:cryptogram 作者: xinmingzhang 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def _create_vertex_list(self):
        if self._subpixel:
            vertex_format = 'v2f/%s' % self._usage
        else:
            vertex_format = 'v2i/%s' % self._usage
        if self._batch is None:
            self._vertex_list = graphics.vertex_list(4, vertex_format,
                'c4B', ('t3f', self._texture.tex_coords))
        else:
            self._vertex_list = self._batch.add(4, GL_QUADS, self._group,
                vertex_format, 'c4B', ('t3f', self._texture.tex_coords))
        self._update_position()
        self._update_color()
__init__.py 文件源码 项目:UMOG 作者: hsab 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __init__(self):
        '''Create a graphics batch.'''
        # Mapping to find domain.  
        # group -> (attributes, mode, indexed) -> domain
        self.group_map = {}

        # Mapping of group to list of children.
        self.group_children = {}

        # List of top-level groups
        self.top_groups = []

        self._draw_list = []
        self._draw_list_dirty = False
sprite.py 文件源码 项目:UMOG 作者: hsab 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def _create_vertex_list(self):
        if self._subpixel:
            vertex_format = 'v2f/%s' % self._usage
        else:
            vertex_format = 'v2i/%s' % self._usage
        if self._batch is None:
            self._vertex_list = graphics.vertex_list(4,
                vertex_format, 
                'c4B', ('t3f', self._texture.tex_coords))
        else:
            self._vertex_list = self._batch.add(4, GL_QUADS, self._group,
                vertex_format, 
                'c4B', ('t3f', self._texture.tex_coords))
        self._update_position()
        self._update_color()


问题


面经


文章

微信
公众号

扫码关注公众号