Package pyjsdl :: Module sprite

Module sprite

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

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

 

pyjsdl.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)

 

pyjsdl.sprite.collide_rect

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

collide_rect_ratio(ratio)

 

pyjsdl.sprite.collide_rect_ratio

Return a callable that checks if the rects of the two sprites intersect. The ratio attribute will determine scaling of the rect, where 1.0 is same size. Can be used as spritecollide callback function.

collide_circle(sprite1, sprite2)

 

pyjsdl.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_circle_ratio(ratio)

 

pyjsdl.sprite.collide_circle_ratio

Return a callable that checks two sprites intersect by checking by intersection of circle around their centers. The ratio attribute will determine scaling of the circle, where 1.0 is same size. Will use sprite radius attribute or circle will encompass rect attribute. Can be used as spritecollide callback function.

collide_mask(sprite1, sprite2)

 

pyjsdl.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)

 

pyjsdl.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)

 

pyjsdl.sprite.spritecollideany

Check if sprite intersect with any sprites in group.