Class pyglet.sprite.SpriteGroup

graphics.Group --+
                 |
                SpriteGroup

Shared sprite rendering group.

The group is automatically coallesced with other sprite groups sharing the same parent group, texture and blend parameters.

Methods

  __init__(self, texture, blend_src, blend_dest, parent=None)
Create a sprite group.
  set_state(self)
Apply the OpenGL state change.
  unset_state(self)
Repeal the OpenGL state change.
  __repr__(self)
  __eq__(self, other)
  __hash__(self)
  set_state_recursive(self)
Set this group and its ancestry.
(Inherited from pyglet.graphics.Group)
  unset_state_recursive(self)
Unset this group and its ancestry.
(Inherited from pyglet.graphics.Group)

Method Details

__init__

(Constructor) __init__(self, texture, blend_src, blend_dest, parent=None)

Create a sprite group.

The group is created internally within Sprite; applications usually do not need to explicitly create it.

Parameters:
texture : Texture
The (top-level) texture containing the sprite image.
blend_src : int
OpenGL blend source mode; for example, GL_SRC_ALPHA.
blend_dest : int
OpenGL blend destination mode; for example, GL_ONE_MINUS_SRC_ALPHA.
parent : Group
Optional parent group.
Overrides:
graphics.Group.__init__

set_state

set_state(self)

Apply the OpenGL state change.

The default implementation does nothing.

Overrides:
graphics.Group.set_state

unset_state

unset_state(self)

Repeal the OpenGL state change.

The default implementation does nothing.

Overrides:
graphics.Group.unset_state