Python pyglet 模块,graphics() 实例源码

我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用pyglet.graphics()

项目:FightstickDisplay    作者:calexil    | 项目源码 | 文件源码
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
项目:FightstickDisplay    作者:calexil    | 项目源码 | 文件源码
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
项目:FightstickDisplay    作者:calexil    | 项目源码 | 文件源码
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()
项目:cryptogram    作者:xinmingzhang    | 项目源码 | 文件源码
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
项目:cryptogram    作者:xinmingzhang    | 项目源码 | 文件源码
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
项目:cryptogram    作者:xinmingzhang    | 项目源码 | 文件源码
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()
项目:UMOG    作者:hsab    | 项目源码 | 文件源码
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
项目:UMOG    作者:hsab    | 项目源码 | 文件源码
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()