Package pyj2d :: Module sprite

Module sprite

Classes
  Sprite
pyj2d.sprite.Sprite
  DirtySprite
pyj2d.sprite.Sprite
  Group
pyj2d.sprite.Group
  RenderPlain
pyj2d.sprite.RenderPlain
  RenderClear
pyj2d.sprite.RenderClear
  GroupSingle
pyj2d.sprite.GroupSingle
  RenderUpdates
pyj2d.sprite.RenderUpdates
  OrderedUpdates
pyj2d.sprite.OrderedUpdates
  LayeredUpdates
pyj2d.sprite.LayeredUpdates
  LayeredDirty
pyj2d.sprite.LayeredDirty
  collide_rect_ratio
pyj2d.sprite.collide_rect_ratio
  collide_circle_ratio
pyj2d.sprite.collide_circle_ratio
Functions
 
spritecollide(sprite, group, dokill, collided=None)
pyj2d.sprite.spritecollide
 
collide_rect(sprite1, sprite2)
pyj2d.sprite.collide_rect
 
collide_circle(sprite1, sprite2)
pyj2d.sprite.collide_circle
 
collide_mask(sprite1, sprite2)
pyj2d.sprite.collide_mask
 
groupcollide(group1, group2, dokill1, dokill2)
pyj2d.sprite.groupcollide
 
spritecollideany(sprite, group)
pyj2d.sprite.spritecollideany
Function Details

spritecollide(sprite, group, dokill, collided=None)

 

pyj2d.sprite.spritecollide

Return list of sprites in group that intersect with sprite. The dokill argument is a bool, True removes sprites that collide from all groups. An optional collided is a callback function taking two sprites and return bool collision.

collide_rect(sprite1, sprite2)

 

pyj2d.sprite.collide_rect

Check if the rects of the two sprites intersect. Can be used as spritecollide callback function.

collide_circle(sprite1, sprite2)

 

pyj2d.sprite.collide_circle

Check two sprites intersect by checking by intersection of circle around their centers. Will use sprite radius attribute or circle will encompass rect attribute. Can be used as spritecollide callback function.

collide_mask(sprite1, sprite2)

 

pyj2d.sprite.collide_mask

Check if mask of sprites intersect. Will use sprite mask attribute or mask generated from image attribute. Can be used as spritecollide callback function.

groupcollide(group1, group2, dokill1, dokill2)

 

pyj2d.sprite.groupcollide

Return dictionary of sprites in group1 with list of sprites in group2 that intersect. The dokill argument is a bool, True removes sprites that collide from all groups.

spritecollideany(sprite, group)

 

pyj2d.sprite.spritecollideany

Check if sprite intersect with any sprites in group.