Home | Trees | Index | Help |
---|
Package pygsear :: Module Drawable :: Class SpriteGroup |
|
object
--+ |Group
--+ |RenderClear
--+ |RenderUpdates
--+ | SpriteGroup
Specialized pygame.sprite.Group
with more
functionality.
SpriteGroup
is that it knows which
window its sprites live in and can draw()
and
clear()
them without needing to pass the screen or
background to the functions.
Method Summary | |
---|---|
Initialize the sprite group. | |
__len__() -> int number of sprites in group (inherited from Group )
| |
a new object with type S, a subtype of T |
|
__nonzero__() -> bool ask if group is empty (inherited from Group )
| |
__repr__(self)
(inherited from Group )
| |
Add sprite to group. | |
add_internal(self,
sprite)
(inherited from Group )
| |
Change the drawing level. | |
Clear all of the sprites in the group to the background. | |
Not used at this time. | |
copy() -> Group copy a group with all the same sprites (inherited from Group )
| |
draw(surface) draw all sprites onto the surface | |
Draw sprites which are not marked hidden | |
empty() remove all sprites (inherited from Group )
| |
has(sprite) -> bool ask if group has sprite (inherited from Group )
| |
Call the kill method on every sprite in this group, to
remove all of the sprites from all of the groups they are in. | |
move(self)
| |
pop(self)
| |
remove(sprite) remove sprite from group (inherited from Group )
| |
remove_internal(self,
sprite)
(inherited from RenderClear )
| |
sprites() -> iterator return an object to loop over each sprite (inherited from Group )
| |
update(...) call update for all member sprites (inherited from Group )
|
Instance Variable Summary | |
---|---|
layer
- Screen.Layer in which the sprites live. |
Method Details |
---|
__init__(self,
layer=None,
sprites=[])
Initialize the sprite group.
|
__new__(S, ...)
|
add(self, sprites, level=0)Add sprite to group.
|
change_level(self, level, to_level)Change the drawing level. |
clear(self)Clear all of the sprites in the group to the background. |
clear_layer(self)Not used at this time. |
draw(self)draw(surface) draw all sprites onto the surface Draws all the sprites onto the given surface. It returns a list of rectangles, which should be passed to pygame.display.update() |
draw_visible(self, surface=None)Draw sprites which are not marked hidden Looks for a .hidden property on each sprite and does not draw those with hidden True |
kill(self)Call thekill method on every sprite in this group, to
remove all of the sprites from all of the groups they are in.
|
Instance Variable Details |
---|
layerScreen.Layer in which the sprites live. All
draw() and clear() operations on the sprites
will use the layer's screen and bg
pygame.Surface s.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 1.1 on Sun Nov 30 19:33:11 2003 | http://epydoc.sf.net |